CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Diffusivity coefficient dependent on the additional variable (https://www.cfd-online.com/Forums/cfx/200055-diffusivity-coefficient-dependent-additional-variable.html)

831726 March 22, 2018 13:29

Diffusivity coefficient dependent on the additional variable
 
2 Attachment(s)
Hi all,

I'm trying to model transport of an additional variable in a fluid domain within CFX. The diffusivity coefficient depends on the additional variable itself.

The following equations may help to understand the problem:

The transport equation for Ht (labelled as H):
Attachment 62271

The diffusion coefficient:
Attachment 62272

where the Ht is the local concentration. Thus it depends on itself.

As far as I have looked, I cannot seem to find a way around to implement this. I have tried adding the additional variable (H) in the equation in CEL expression however it comes with error in the solver.

Does anyone know how to overcome this in CFX Pre? If not is it possible to do in Fortran? I have no experience in using Fortran so any suggestions/ advice/ guide to approach it would be much appreciated! Have been stuck on this for couple of months and little bit frustrated :(

Many thanks!
Saj

Gert-Jan March 22, 2018 16:21

Not that I have a direct solution, but maybe we can mail it down. Questions I have:
- what error do you get?
- when do you get this error?
- in your equation you have a symbol epsilon. What's this? Is it the Eddy Dissipation rate?
- Are you sure you get realistic values for the diffusion coefficients all the time? Meaning, do you always get positive values?
- Or in other words: how does your CEL-equation exactly look like? Did you use min/max limiters?

Regs, Gert-Jan

ghorrocks March 22, 2018 16:24

Does CFX-Pre allow you to do this? Or does the solver crash with a numerical error?

How big a range do you expect the diffusivity to vary over in your simulation?

I suspect the numerical system you are proposing is significantly different to the normal equations and so you are probably going to have to do some numerical stuff to get this to converge - and that is if it is solvable at all, that is not guaranteed.

You will certainly need to use the normal tricks to get tricky simulations to converge - so small time steps, double precision, good quality mesh, good initial condition. But this might need to put some underrelaxation on that equation and possibly other things. You can do underrelaxation in the GUI but if that is not enough you might need fortran to impose more sophisticated techniques.

831726 March 23, 2018 04:33

Thanks for your reply. Hope the following answers your questions:

CEL expression is written as:

DiffusionCoefficient = ESDiffusion*(1-3.77* epsilon* Ht+3.7* Ht^2* epsilon^2)
ESDiffusion = (boltzmann * 1 [K]) / (6*pi*0.0012 [kg m^-1 s^-1]* 3.5e-6 [m])
epsilon = (SRate^2)*0.1931611631 [s^2]

where Ht is a additional variable

Diffusion constant is expected to be all positive values since Ht is a volume fraction. If Ht equals to 0, value would still be positive since 'ESDiffusion' is a constant positive value.

Error in the solver states:

'Error processing expression 'Kinematic Diffusivity'.
The expression is invalid because:
HAEMATOCRIT is not available for use in this term
Error processing expression: Kinematic Diffusivity = DiffusionCoefficient'

831726 March 23, 2018 04:45

Thanks for your reply.

Currently the solver crash on CFX Command Language for the Run therefore it doesn't converge. I understand this is due to the incorrect input in CEL expression as in CFX doesn't allow additional variable to be expressed in the equation where the diffusion coefficient of the additional variable is calculated from. In the post above I have written down the expression and the error stated.

I was also wondering if there is a way to define the local concentration/ Volume fraction per cell in CEL expression.

ghorrocks March 23, 2018 06:13

The solver stops you from doing this because it cannot handle it. You are changing the fundamental equations so the solver may not be a valid approach any more.

How big a range do you expect the diffusivity to vary over in your simulation?

Opaque March 23, 2018 08:26

OK.. It is always best to start with the original error.

You are getting a validation error indicating the expression for Kinematic Diffusivity does not support the use of Additional Variables in the expressions.

Nothing so far about the equation you are trying to solve.

If you want to bypass the validation error, you can try (at your own risk), adding the following section of CFX Command Language

RULES:
PARAMETER: Kinematic Diffusivity
Dependency List = ANY
END
END

The above has been suggested in the forum to bypass similar hardcoded limitations. However, once you bypass you could encounter other errors downstream. For example, as others have suggested, numerical instabilities; therefore, be prepared to reduce your timestep, relaxation, etc.

Good luck

Gert-Jan March 23, 2018 08:43

Given this workaround, I would add that you definitely need to min/max your equation to obtain reasonable values. Epsilon can vary from very small to very high values, especially at the start of the iteration process or at bad elements. These can easily lead to unrealistic diffusivities, leading to divergences or fpx-errors.

Good luck, Gert-Jan

evcelica March 27, 2018 17:28

Have you check the turbulent diffusion contribution compared to molecular? Usually this is >> molecular diffusion, so whatever you put in for molecular will not really matter much, unless you have a special case.

If it does matter, and you are running steady state solution. you could obtain your initial solution with a constant kinematic diffusivity, then make that diffusivity a function of position(x,y,z) based on your initial results, Iterate.

831726 June 25, 2018 07:25

Problem solved
 
Using Opaque's suggestion problem was solved!


All times are GMT -4. The time now is 04:07.