CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)

 bearli July 1, 2010 01:15

Hi everyone,

I´m trying to model the transport of an additional variable in a fluid (water) domain within CFX. The diffusivity of the corressponding transport equation is also dependent on the additional variable I´m trying to model.

The definition of this kinematic diffusivity in CFX results in an error. Therefore I´d like to know wheter it is possible to use this approach or if not, what other approach might be feasible?

bearli

 ghorrocks July 1, 2010 18:47

If the diffusion coefficient is a function of the transport equation variable you are no longer using a standard additional variable transport equation. You will have to have a careful think about how to implement this numerically as it is tricky to get stable.

So by default I think CFX will reject this (as you have found), but you may be able to trick it by defining either a CEL function with the diffusivity or an additional variable with the diffusivity and using that as your diffusion coefficient. The aim here is to get the diffusivity to take the value from the previous iteration rather than being coupled.

If this does not work your only way forward is to do a user fortran routine to set the diffusivity.

Can you describe what you are doing?

 bearli July 2, 2010 07:25

Quote:
 Can you describe what you are doing?
Sure, I´m trying to modell the transport of oxygen in a liquid. Inside the liquid there is a further oxygen source (S). Since the mass of the oxygen is comparably small I decided not to modell the oxygen content with a multicomponent mixture but with an additional variable (as partial pressure ) that is treated in a further transport equation.

were as well as

Quote:
 but you may be able to trick it by defining either a CEL function with the diffusivity or an additional variable with the diffusivity and using that as your diffusion coefficient. The aim here is to get the diffusivity to take the value from the previous iteration rather than being coupled
As you suggested I will try to implement this approach first. However, I´m having some trouble accessing the value from the previous iteration. In this forum I found a similar question that remains unanswered ( http://www.cfd-online.com/Forums/cfx...iteration.html ). In the CFX reference guide the cel function citern is mentioned but I don´t know how to link it to the access of my variable.

 ghorrocks July 2, 2010 07:38

Quote:
 ...Since the mass of the oxygen is comparably small I decided not to modell the oxygen content with a multicomponent mixture...
Why not? That seems to be the best way to do this rather than having to specify non-constant constants in a transport equation.

There is no way in CEL to access variables from previous iterations or timesteps. My suggestion about using a CEL variable or a further additional variable is you may be able to trick CFX into giving you the value from the previous time step. From memory, CEL is evaluated at the start of an iteration before the equations are solved. The CEL is evaluated based on the values from the last iteration. So you may be able to use this to get the CEL to evaluate using the values from the last iteration and then solve the equations. You will have to fiddle with this to get it to work. You might need an additional CEL expression in there, you might need a callback function (eg probe, areaAve() etc) or you might need an additional variable.

As what you are trying to do is make use of an "undocumented feature" you will need to fiddle to get it to work - and no guarantees it will work at all in the end.

 bearli July 7, 2010 12:10

Thanks for the answer. I had some tries but finally I decided to model my problem in FLUENT with UDS/UDF. Works fine!

 All times are GMT -4. The time now is 10:55.