Quantcast
Channel: Solving, solving\ - Latest Discussions - COMSOL Forums
Viewing all 3988 articles
Browse latest View live

Initial Pressure - error

$
0
0
Hi everyone,

I try to model the influence of a heated boundary on surrounding air in a 3-d model. When I try to set the initial pressure in the laminar flow to:
-spf.rho*g_const*(0.05[m]-z)

I always get the following error message:

Error in user-defined function.
- Function: dcomp1.mat1.def.rho_drho__T__internalArgument
Failed to evaluate temporary symbolic derivative variable.
- Variable: comp1.ht.rho@VDN$comp1.T
- Defined as: (unit_kg_cf*(dcomp1.mat1.def.rho_drho__T__internalArgument(comp1.ht.fluid1.minput_pressure/unit_Pa_cf,comp1.ht.fluid1.minput_temperature/unit_K_cf)*(1/unit_K_cf)))*(1/(unit_m_cf^3))
Failed to evaluate temporary symbolic derivative variable.
- Variable: comp1.ht.C_eff@VDN$comp1.T
- Defined as: (((unit_kg_cf*(dcomp1.mat1.def.rho_drho__T__internalArgument(comp1.ht.fluid1.minput_pressure/unit_Pa_cf,comp1.ht.fluid1.minput_temperature/unit_K_cf)*(1/unit_K_cf)))*(1/(unit_m_cf^3)))*comp1.ht.Cp)+(comp1.ht.rho*((unit_J_cf*(dcomp1.mat1.def.Cp(comp1.ht.fluid1.minput_temperature/unit_K_cf)*(1/unit_K_cf)))*(1/(unit_K_cf*unit_kg_cf))))
Failed to evaluate expression.
- Expression: dvol*(comp1.ht.d*(comp1.Tt*(-((((unit_kg_cf*(dcomp1.mat1.def.rho_drho__T__internalArgument(comp1.ht.fluid1.minput_pressure/unit_Pa_cf,comp1.ht.fluid1.minput_temperature/unit_K_cf)*(1/unit_K_cf)))*(1/(unit_m_cf^3)))*comp1.ht.Cp)+(comp1.ht.rho*((unit_J_cf*(dcomp1.mat1.def.Cp(comp1.ht.fluid1.minput_temperature/unit_K_cf)*(1/unit_K_cf)))*(1/(unit_K_cf*unit_kg_cf))))))))
Failed to evaluate Jacobian of expression.
- Expression: dvol*(((-comp1.ht.C_eff)*comp1.Tt)*comp1.ht.d)
Failed to evaluate Jacobian of expression.
- Expression: (-comp1.ht.C_eff*comp1.Tt*test(comp1.T)*comp1.ht.d)*(dvol)

It would be great, if somebody could help me!!

Thanks a lot in advance! :D

Diluted species transport - singularity error

$
0
0
Hi,

I am trying to model the drying of wood in a cylindrical drum with fixed wall temperature.

I keep getting an error at around 1.7 seconds into my simulation. Can anybody help me solve this issues or guide me to some examples I can look at that can help me.

Thank you,

Nadeem

Relative tolerance vs Relative Error

$
0
0
Hi all,

having read many relevant threads and also searched in the comsol manual , i still dont understand the difference (if there is indeed some) between relative error and relative tolerance.

for example:
1)in this thread (also in manual)
www.comsol.com/community/forums/general/thread/13157

''The Relative tolerance value is the relative error tolerance that the ODE solver uses.''
''Use the Relative tolerance edit field to enter a positive number. This number controls how accurately the nonlinear system of equations is solved in each time step. In general, the desired relative error in the solution should be entered here.''

2)in comsol manual
''The software stops the iterations when the relative tolerance exceeds the relative error computed as the weighted Euclidean norm''
suggesting a difference

i need some clarification
V4.4

Thanks in advance

AC current simulation

$
0
0
Dear COMSOL community,
I am kind of new to COMSOL and I am building a Lorentz force based MEMS sensor. Basically the current passing through an Aluminum wire on top of the cantilever will interact with the magnetic field from the permanent magnet thus causing the cantilever to deflect accordingly. I manged to simulate it but currently i am using DC current (using single turn coil and terminals) and didn't got any deflection so i think that i should use AC current with a frequency equals to the resonance frequency of the cantilever, could anyone please tell me how i can simulate this ? I already got the eigenfrequencies from another study so i know the resonance frequency. I just need to simulate the AC current now. By the way , i am using stationary study now, should i use frequency domain ?

Looking forward to your answers and discussions,
Best Regards,
Amal

Time-Dependent initial solution violates specified initial conditions

$
0
0
I am trying to build a dye-washout model (using Reacting Flow in Porous Media physics to predict the time-dependent concentration of a dilute species). I'm able to run simulations for varying lengths of time, but I'm having issues with my initial conditions.

I specify what the initial concentration of the dilute species should be with an Initial Values node, but when I run the time-dependent study the t0 concentration does not match what I specify. For example, I specify concentration should uniformly be 0.1 mol/m^3 at t=0, but instead the solution will show a non-uniform concentration distribution with an average ~5-50% lower than the Initial Values node indicates. The discrepancy from the specified initial concentration also changes with study length (i.e. ~5% error for study from t=0-0.1sec, ~50% error for study from t=0-10sec).

Am I specifying initial conditions incorrectly? Is there a way to strictly enforce initial conditions?

Importing data in 3 dimensions to COMSOL

$
0
0
Hello everyone, I have a question about importing data into COMSOL which I would then like to impose on my model. I have an excel spreadsheet that contains Width(x) and Length(y) and then x*y amount of data points for Power Density(z). I'm not quite sure how I can important this amount of data in to COMSOL. Do I need to come up with a function for the power density z and then apply this separately to my model? Any help or hints in the right direction are greatly appreciated; thanks in advance. I should include that I have been trying to use the interpolation function without much success.

Nick

Elasticity matrix in solid mechanics eigenfrequencies

$
0
0
Dear all,
I am trying to study the vibrational eigenfrequency of a silicon nanostructure. I have built the geometry and when I try to define the materials, I used single crystalline Si with anisotropic properties in which I could define the elasticity matrix that I obtained through other calculations. However I noticed that the elasticity matrix doesn't have a check mark in front of it, so this information is not required in this case. I know there must be something that I did wrong, but I am kinda new to COMSOL and any suggestions would be greatly appreciated! Thank you very much!

Best wishes,

Vincent

Problem on result when simulate varied force between two permmanent magnet plates

$
0
0
Hi,

Currently, I am working on a 3D model of two permanent magnet plates (I have attached model below, the permanent magnet plates have alternating polarity). One permanent magnet plate can move in the direction parallel to the other permanent magnet plate. Now, I want to find relationship between force in motion direction and the displacement. I use AC/DC model for the magnetic field. I also use infinite elements to be the boundary. Basically, I follow the every setting of a tutorial on 3D axial magnetic bearing from COMSOL.

However, the result I have is weird (see the attachment), the plot is not smooth and even the force at 0 displacement is not 0 which should be 0 because of the symmetry. Since I am a beginner on COMSOL, I can't figure out where the problem is from. Can anyone help me on this?


Sincerely,

Xingjian Liu

How to plot time-dependent temperature profile at a point

$
0
0
Hi all,

I have 1 question over here, i have been using the SAR head tutorial (Provided by comsol tutorial) to do research for my school project and i have 1 problem over here which is, i cant seems to plot temperature VS time graph. i had searched though the internet for solution and i did follow their steps but still i cant manage to get it. whatever i try to plot, the time will varies but the temperature remains the same throughout which makes my curve looks like one horizontal straight line.

I will really appreciate if someone can take a look at the attached picture (i can't seems to upload my model file here) and suggest to me what should i do next.

Thanks,
Boon

How do you plot error in COMSOL Multiphysics V5.2?

$
0
0
While doing the simulation in COMSOL Multiphysics V5.2, I found that there were errors being plotted (for my case, it was from Convergence plot 1 and 2 I think).

I would like to get this graphs for my thesis. Do you know how I can plot these errors? 

How do you plot error in COMSOL Multiphysics V5.2?

ResearchGate. Available from: www.researchgate.net/post/How_...ror_in_COMSOL_Multiphysics_V52 [accessed Mar 28, 2016].

Convergence problem with Bi-directionally coupled magnetostrictive model

$
0
0
Dear all,

I am now working on implementing the magnetostrictive model on COMSOL, for which I encountered a converging problem and I'm looking for your help.

The constitutive equations I am interested in is strongly coupled between magnetic and elastic fields, as shown below:
T_{ij} = c_{ijkl}*S_{kl} - e_{kij}*H_k
B_i = e_{ijk}*S_{jk} + mu_{ij}*H_j
where T and S are stress and strain; B and H are magnetic flux density and magnetic field intensity.
c is the stiffness constants, e the strain to magnetic field coupling constants, and mu permeability.
[c.f. Journal of Applied Physics 104, 074104 (2008) ]


Basically, my model consists of a cantilevered beam surrounded by an air box which is a cylinder (in 3D).
I added "Solid Mechanics" and "Magnetic and Electric Fields" as physics interfaces.
The boundary conditions are:
fixed constraint on one end of the beam for mechanical interface.
magnetic field along the beam-length direction on the curved surface of the cylinder, and perfect magnetic conductor on the both ends (flat) of the cylinder.

The mechanical problem is only solved on the beam domain.
To enforce the constitutive equations, I added :
1° non-zero initial stress under the linear elastic material feature of the solid mechanics interface;
2° a second Ampère's law and Current conservation feature on the beam domain and chose Remanent flux density under the Magnetic field section. I then added non-zero Br components as a function of the e constants and mechanical strain (solid.el11 for example).

For the solver, I tried almost all possible combinations (direct, iterative, multigrid ...). The direct method is not appropriate because of memory insufficiency. For iterative methods, none converged, which seemed very strange to me.

Can you help me with that, please? B.t.w., I've already read the nonlinear magnetostrictive model in your model library which does not help much in my case.
Looking forward to hearing from you soon.

Thanks!

Minimising a functional in COMSOL - Optimization

$
0
0
Hi all,

I am trying to minimize a functional in COMSOl through the optimisation module. The functional depends on two functions E(x) and G(x) (and their derivatives up to second order) plus two constants c1 and c2.

So, I wrote the energy (my functional) and used an integral objective in the optimisation module. Also, I specified E and G as control variable fields. Then, in the optimisation solver, I used the Nelder-Mead method in which I specified c1 and c2 as control parameters.

The model runs and the method varies c1 and c2 but it seems that the objective does not change when they vary. At the end, c1 and c2 are always equal to their initial values. Am I doing something wrong?

Thank you very much in advance.

Best regards,
Matteo

Way to speed up stopping of simulation? / way to keep COMSOL from disappearing after error?

$
0
0

Hello dear colleagues,

Currently I am working on a model for reversed combustion of biomass using an Equilibrium model based on Gibbs Free Energy for the gas reactions. I have made a connection with Matlab using livelink. Unfortunely sometimes things go wrong for unclear reasons.

When I want to stop the simulation, it often takes hours and hours while it is apparently doing nothing. Why?
How to force COMSOL to stop without losing the solution?

Also, it seems sometimes Matlab gets a vector containing only NaN's and the script I made can't return anything useful then. Instead of just stopping, COMSOL completely disappears entirely, not a trace left. WHY?
In the log it says it can't find the matlab function. This is not true, it just can't handle the crap from COMSOL.
Why is COMSOL and everything with it completely removed from memory? It there a way to prevent this?

Thanks and kind regards,

Ray

Time Dependent Study

$
0
0
Hello everybody,

There's something about the time dependent studies in COMSOL that I'm not able to understand and I would like you to help me if possible.

I am solving a heat transfer problem and, to do this, I am using a time dependent study. I have done two different simulations:

1) I have solved the problem for 10 seconds, using a time step of 5 seconds ("range(0, 5, 10)")
, and then calculated the temperature in one point of the domain at t = 5s.

2) I have solved the problem for 5 seconds, using a time step of 5 seconds ("range(0, 5, 5)"), and then calculated the temperature in the same point as in the first simulation, also at t =5s.

I was expecting to obtain the same result in the two simulations since the problem is exactly the same, but the results were different. I have noticed that if I change the time for the simulation to stop, the results, even in a same moment, differ. Could you explain me why this happens?

Thanks in advance.

Displacement due to point contact

$
0
0
Hi,
I want to simulate how a planar surface is depressed by the weight of a overlaying sphere (gravity loading) in Structural Mechanics Module. Both sphere and planar surface are expected to be in point contact. First I attempted a 2D version of this problem using circle and a rectangle as shown in attached figure. The bottom boundary of the rectangle is constrained while a body-force is applied on the circle. There is no issue with the mesh. But when I run the Study, Comsol simply gives an error message:
Failed to find a solution.
The relative error (0.69) is greater than the relative tolerance.
Returned solution is not converged.
- Feature: Stationary Solver 1 (sol1/s1)

To finalized the circle and rectangle geometry, I tried both "form union" and form "assembly options" but no success. The problem seems to be the "point-like contact" between the circle and the rectangle which is creating some singularity and preventing the solution from converging. The solution can be made to converge artificially by introducing a small boundary overlap between the circle and the rectangle. This I have tested without any issue by moving the rectangle upwards by a small amount so that there is a finite overlap between circle and rectangle. This also shows that problem is setup correctly. The solution fails only when the two domains are in 'point-like' contact. This is something I did not encounter before. I would like to know if there is robust and fool-proof way to handle point-like contacts/boundaries between the objects in COMSOL? It is possible that I am missing something very trivial, but I would greatly appreciate if any of you could share your valuable insight.
Thank you
Ravinder

Error increases with mesh density for trivial 1D model

$
0
0
Having had some problems, I reduced them down to a surprisingly minimal example:

• 1D, single interval, Laplace equation.
• Dirichlet BC on left end: fix it at "1.0".
• (There is a zero-flux BC on the right end by default.)
• Mesh has 500,000 equally-sized elements.
• Everything else is at default values.

The result comes back with a massive error (see the plot, attached) and relative error indicator (LinErr) of 0.0031 (MUMPS), 0.0047 (PARDISO), 0.0032 (SPOOLES).

The error is solver-dependent for the three direct solvers, which should all be, theoretically, producing the same answer. But they are not, as can be seen from the residual plot. All answers are bad by at least 0.0003 at the free end. So we only get 3 significant figures accuracy out of this trivial simulation.

Of course it's clear that this has something to do with numerical errors accumulating due to the large number of elements. However, 1 million DOFs doesn't sound like a big job for Comsol.

Typically we expect the error to decrease as we refine the mesh further and further. But with this example, the error keeps increasing:

Elements DOFs LinErr
500 1001 4e-8
5000 10001 2e-6
50000 100001 4e-4
500000 1000001 5e-3

So instead of converging to the right answer with mesh refinement, it diverges!

I was under the impression that these sorts of effects (when the mesh becomes too fine) won't come into play until some very large numbers of elements that we never need to worry about. This seems to be wrong now, and is a nuisance, because now it works against error estimation by mesh refinement. I don't really understand the nature of these errors, actually, beyond the imprecise "accumulation of round-off and discretisation errors". It would be good to get a feel for how fine is too fine, for different types of problems and geometries. Any ideas?

assemble external force vector rather than the residual vector by comsol

$
0
0
Hi all,
In a simple linear elastic problem, a FE equation can be written as K*U=F, I would like to know if comsol can assemble and output this "F" vector?
In the documentation, it seems that comsol can output the residual vector "L" rather than "F".
Actually I need to output a vector which has the expression as: integrate(test(u)*w(x,y)) on domain or boundary, in which u is the dependent variable, and w(x,y) is the function I defined. I find this expression is in same format as the "F" vector mentioned above. So I need help to get the "F" vector or evaluate the vector with expression as integrate(test(u)*w(x,y)) directly.
Thank you all.

In Segregated Step 1: There was an error message from the linear solver. The relative error (2.2e+002) is greater than the relative tolerance.

$
0
0
Hi all,

Why does this error happen and how do I solve it?

This is the log file:

============================================================
Minimum element quality: 0.03333
============================================================
Stationary Solver 1 in Study 1/Solution 3 (sol3) started at 18-Mar-2016 08:12:59.
Nonlinear solver
Number of degrees of freedom solved for: 86118.
Nonsymmetric matrix found.
Scales for dependent variables:
Electric potential (mod1.V): 29
Displacement field (Material) (mod1.u): 6.5e-008
Pressure (mod1.p): 1e+005
Displacement field (Material) (mod1.u2): 1e-008
Orthonormal null-space function used.
Iter SolEst ResEst Damping Stepsize #Res #Jac #Sol LinErr LinRes
1 0.065 3.2 1.0000000 7.2 2 1 2 2.1e-010 1.9e-011
2 3e-006 0.00061 1.0000000 0.031 3 2 4 1.7e-010 8.3e-012
Stationary Solver 1 in Study 1/Solution 3 (sol3): Solution time: 3 s
Physical memory: 1.28 GB
Virtual memory: 1.41 GB
Time-Dependent Solver 1 in Study 1/Solution 3 (sol3) started at 18-Mar-2016 08:13:04.
Time-dependent solver (BDF)
Number of degrees of freedom solved for: 73170.
Nonsymmetric matrix found.
Scales for dependent variables:
Pressure (mod1.p2): 1e+005
Velocity field, continuous phase (Spatial) (mod1.uc): 3.8e+002
Velocity field, dispersed phase (Spatial) (mod1.ud): 3.4e+002
Nonsymmetric matrix found.
Scales for dependent variables:
Volume fraction, dispersed phase (mod1.phid): 0.0093
Nonsymmetric matrix found.
Step Time Stepsize Res Jac Sol Order Tfail NLfail LinErr LinRes
0 0 - out 22 15 22 0
Group #1: 11 3 11 0.005 1.2e-013
Group #2: 11 12 11 1.7e-013 1.5e-016
1 2.5e-005 2.5e-005 94 65 93 1 0 1
Group #1: 34 5 34 0.00032 5.8e-014
Group #2: 60 60 59 1.4e-013 2.2e-016
2 7.5e-005 5e-005 100 69 99 1 0 1
Group #1: 37 6 37 0.0094 3.9e-014
Group #2: 63 63 62 1.4e-013 2.2e-016
3 0.000175 0.0001 102 71 101 1 0 1
Group #1: 38 7 38 0.0024 5.5e-014
Group #2: 64 64 63 1.4e-013 1.8e-016
4 0.000375 0.0002 104 73 103 1 0 1
Group #1: 39 8 39 0.0047 2.8e-014
Group #2: 65 65 64 1.4e-013 1.7e-016
5 0.000775 0.0004 107 76 106 1 0 1
Group #1: 40 9 40 0.0042 1.6e-014
Group #2: 67 67 66 1.6e-013 1.8e-016
6 0.001575 0.0008 110 79 109 1 0 1
Group #1: 41 10 41 0.00086 2.2e-014
Group #2: 69 69 68 1.9e-013 1.6e-016
7 0.003175 0.0016 122 88 121 1 0 1
Group #1: 45 11 45 0.0078 3.5e-014
Group #2: 77 77 76 1.6e-013 1.6e-016
8 0.006375 0.0032 125 91 124 1 0 1
Group #1: 46 12 46 0.0054 7.2e-014
Group #2: 79 79 78 1.4e-013 1.5e-016
- 0.01 - out
9 0.012775 0.0064 150 109 149 1 0 1
Group #1: 54 13 54 0.00069 3.9e-014
Group #2: 96 96 95 1.6e-013 1.6e-016
- 0.02 - out
10 0.022775 0.01 190 133 189 1 0 1
Group #1: 71 14 71 0.0098 1.4e-014
Group #2: 119 119 118 2.4e-013 2.1e-016
- 0.03 - out
11 0.032775 0.01 195 137 194 1 0 1
Group #1: 73 15 73 0.004 1.1e-014
Group #2: 122 122 121 1.6e-013 2.1e-016
- 0.04 - out
12 0.042775 0.01 204 144 203 1 0 1
Group #1: 76 16 76 0.0082 5.6e-014
Group #2: 128 128 127 1.8e-013 1.6e-016
- 0.05 - out
13 0.052775 0.01 235 161 234 1 0 1
Group #1: 91 17 91 0.00085 8.7e-015
Group #2: 144 144 143 1.9e-013 1.6e-016
Warning: In Segregated Step 1:
Warning: There was an error message from the linear solver.
Warning: The relative error (2.2e+002) is greater than the relative tolerance.
Stopped
Time-Dependent Solver 1 in Study 1/Solution 3 (sol3): Solution time: 3143 s (52 minutes, 23 seconds)
Physical memory: 1.67 GB
Virtual memory: 1.74 GB

Accessing eigenvalue of solution in a material sweep

$
0
0
Hi,

I want to access the 2nd eigenfrequency in a material sweep to calculate the frequency difference between two materials. I managed to access the eigenfrequency with

withsol('sol1',freq,setind(lambda,2)).

How can I access the solution for a special material in this solution.

Kind regards,
Levin

convergence error during simulation

$
0
0
Hello,
I am doing a hyperelastic simulation on a silicone rubber sheet with dimensions 50*50*5mm, with pressure being applied on the surface. But after a certain pressure range, I get this error saying:

"Failed to find a solution for all parameters,
even when using the minimum parameter step.
No convergence, even when using the minimum damping factor.
Returned solution is not converged."

What could be the possible reasons for this? I kept changing the mesh size too..but still no effect.
Viewing all 3988 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>