|
[Sponsors] | |||||
How does CFX deal with small diffusion coefficients? |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Join Date: Jun 2017
Posts: 40
Rep Power: 10 ![]() |
Hello,
My question is a bit related to the CFX solver theory. It is known that small diffusion coefficients (like 1 e -11 m^2/s) may cause numerical instabilities. I was wondering if anyone has a clue how CFX deals with such issues when you solve transport equations for additional variables. Thanks a lot. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,196
Rep Power: 24 ![]() |
I don't think this would cause numerical instabilities.
That said, is your flow turbulent? If so then turbulent diffusion will be much larger than the molecular diffusion, so this coefficient will not matter too much anyways. |
|
|
|
|
|
|
|
|
#3 |
|
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 18,011
Rep Power: 146 ![]() ![]() ![]() ![]() |
Erik is correct, a low diffusion coefficient will not cause problems. It just means there will be just about no molecular diffusion.
A low viscosity might cause problems. In some cases this can cause the flow to go highly unstable. Viscosity is required to keep the flow stable. Is this what you mean?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
|
|
|
|
|
|
|
#4 |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
May I please follow up on this?
Although not problematic, with low Diff Coeff. and in pure diffusion case (flow turned off by expert parameters) with nonlinear source terms, it takes for ever to solve the problem. I have a case (2D, additional variables and source terms) and as soon as I increase the time step above 1 second the linear solver overflows. Well, in a case where this diffusion problem is solved for 1 month duration, it will take a year to converge!!! In COMSOL, it starts with millisecond time step and goes up to hours and converges within 1 hour. How to accelerate the problem convergence in CFX? Thanks |
|
|
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
To be specific, you are solving a pure diffusion problem + sources.
In steady state, or transient? |
|
|
|
|
|
|
|
|
#6 | |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Quote:
I am doing it transient now, but the steady simulation is not also fast enough. |
||
|
|
|
||
|
|
|
#7 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
Steady-state convergence is all about linearization, and coupling; otherwise, the algorithm relies on a small timestep as an under-relaxation mechanism.
Would you mind stating the form of the equations? In particular, the sources and the form of the diffusion coeffcients? |
|
|
|
|
|
|
|
|
#8 | |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Quote:
Thanks, absolutely! There are 3 different Additional variables, first is free drug diffusion-reaction Eq, dC/dt = Dd2C/dx2 + Dd2C/dy2- Ka1*C*(B1-P) - Ka2*C*(B2-Q) + Kb1*P + Kb2*Q and the other two are bound drugs dP/dt=Ka1*C*(B1-P)-Kd1*P, dQ/dt=Ka2*C*(B2-Q)-Kd2*Q, only reaction; i.e. source and sink |
||
|
|
|
||
|
|
|
#9 |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Just to clarify further, it works, and the results are ok, but it takes forever and crashes as soon as time step is increased. A similar simulation in COMSOL for instance takes 1 hour and the time step goes as high as hours. In CFX, takes days or weeks on cluster.
|
|
|
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
Interesting system.
I assume you have - created 3 AddVariables - activated the 3 AddVariables as Diffusive Transport Equation, use D as the diffusion coefficient for one of them, and 0/small for the other two - created a sub-domain - activated sources for each AddVar in the sub-domain - added the strength of the sources as described in the equation - added source coefficient for the sources Would you mind describing the form of your linearization coefficients? and also I assume your variables are positive definite, correct? |
|
|
|
|
|
|
|
|
#11 | |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Quote:
Thanks! I could not explain it better Opaque! The Diff coeff cannot be zero, nor smaller than 1e-16. An Ansys expert told me not to put any number and it actually worked. I have added NO source coefficients. Could you please explain what you mean by linearization coefficient? I have done none in that regard. Yes you are correct. Positive definite. |
||
|
|
|
||
|
|
|
#12 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
If you have no source coefficient (linearization coefficient), I am surprised you can even get a solution at all. The timestep must be infinitesimally small.
Linearization (source coefficients) of positive definite variables is an art; however, the first approach (for segregated solution algorithm) is to compute the derivative of the source respect to the solution variable. In your case (barring typing errors), the source coefficients would be Eq 1 --> - abs(Ka1*(B1-P) +Ka2*(B2-Q)) Eq 2 --> - (Ka1*C + Kd1) Eq 3 --> - (Ka2*C + Kd2) That is a zero approximation w/o controlling the positive definite aspect of neither C, P nor Q. Worth a try though It would be great if you share the convergence plot as well with and w/o linearization. Update: I recall answering similar questions years ago. Using the Forum "Advanced Search" tool for one of my post, and "linearization" will find it for you. In summary: there is a "Combustion Source Term Linearization" section in the CFX-Solver Theory doc worth looking at it if you feel numerically inclined. That is how combustion reaction mechanism are treated in CFX-Solver. |
|
|
|
|
|
|
|
|
#13 |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Opaque,
Thanks a lot for your time and elaborate explanation. I will apply, even this rough source coefficients, and put updates here. You are right. Probably I was lucky starting with infinitesimally small time points. |
|
|
|
|
|
|
|
|
#14 |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Opaque,
Just wanted to update that your solution of lineraization PLUS adaptive time stepping works like a charm. Thanks a lot |
|
|
|
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
Glad to hear you got the algorithm to work w/o issues.
Did you observe any out of bounds values? Say < 0, or > 1 (normalized concentrations-> mass fractions) I wonder if this case could have been setup using the built-in reactions mechanism? |
|
|
|
|
|
|
|
|
#16 | |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Quote:
Good point! I only observed small negative values (1.3e-6). I would rather even fix these. Any hint? Would you direct me to study on built-in reactions mechanisms that you mentioned? totally new to me. |
||
|
|
|
||
|
|
|
#17 |
|
Senior Member
Join Date: Jun 2009
Posts: 1,938
Rep Power: 34 ![]() |
ANSYS CFX can be customized for specific reactions. Check the CFX-Pre Users Guide (Chapter 28) - Materials and Reactions
On the negative values, if they are small and located in regions of low interest, I would not worry about them. Otherwise, check the section I mentioned earlier "Combustion Source Term Linearization" Now keep in mind that some meshes can produce out of bounds solutions, and there is nothing you can do to prevent that besides except improving the mesh quality. Clipping solution values do nothing except exacerbate the problem somewhere else. |
|
|
|
|
|
|
|
|
#18 |
|
Member
Ftab
Join Date: Sep 2011
Posts: 87
Rep Power: 16 ![]() |
Thanks a lot Opaque!
I learned a lot and fixed an issue which was a nightmare with your help! |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [ICEM] Simple pipe meshing - problems with y+ in CFX | Keizers | ANSYS Meshing & Geometry | 23 | January 15, 2015 09:00 |
| cfx diffusion to porous media | bitak | CFX | 3 | November 9, 2012 16:18 |
| How to stop diffusion and advection in a zone for selected species. | hda | FLUENT | 0 | March 19, 2012 00:59 |
| Pros and Cons for CFX, CFdesign, COMSOL | Val | Main CFD Forum | 3 | June 10, 2011 03:20 |
| CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 05:07 |