Implementing an Equation
Hi FOAMERS
Do you know the simplest way to implement equation "dC/dt + grad(CL).V = 0", where C and CL are scalar and V is the velocity vector? |
This could be done as
Code:
fvScalarMatrix CEqn Code:
fvScalarMatrix CEqn |
Daniel
Thanks for your answer. In my case C = (gL + kp*(1-gL))CL, where gL is a volScalaerField and kp is constant. You have any ideas of the best way to implement this? By the way, can you explain why adding term "fvm::SuSp(-fvc::div(phi),C)" makes it more conservative? |
Quote:
the Code:
fvm::SuSp(-fvc::div(phi),C) If there is incomplete convergence in your momentum portion of your solver, this will account for that fact. For a completely converged velocity field, this term will approach zero for an incompressible fluid (i.e. by the nature of continuity). Take a look at the thread http://www.cfd-online.com/Forums/ope...silon-eqn.html and the post http://www.cfd-online.com/Forums/ope...tml#post280210. This is also implemented in the k-epsilon turbulence models if you would like to look at them. |
Dear chegdan,
I believe the left side of your equation is conservative form, the right side is called primitive form. The reason for the name comes from gas dynamics and passing through the shocks. When you use the left hand side (consider C as as rho) passing through the shock your momentum will remain constant, however on your right hand side every term experiences a severe gradient which makes numerical instabilities in presence of shock. PS: I'm speaking in the context of gas dynamics, please let me know if I'm wrong. |
Quote:
|
All times are GMT -4. The time now is 11:07. |