CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Question about EEqn.H file (https://www.cfd-online.com/Forums/openfoam-programming-development/138614-question-about-eeqn-h-file.html)

harshad88 July 7, 2014 23:56

Question about EEqn.H file
 
Dear all,

I am trying to develop a new solver for premixed flame simulations using reactingFoam. I have a question about the EEqn.H file in the default code. It reads:

+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)


What is the meaning of fvc::absolute(phi/fvc::interpolate(rho), U), and the line : -dpdt ???

Your help would be really appreciated. Thanks :)

wouter July 8, 2014 17:26

Hello harshad88,

I am no expert.
It is part of a C or C++ construct A?b:c meaning
if A is true than b else c in this case c = "-dpdt"

hope this helps
Wouter

harshad88 July 9, 2014 11:10

Thanks for your reply Wouter.

Could you also tell me what the meaning of fvc::absolute(phi/fvc::interpolate(rho), U) is? I cant understand what this terms corresponds to in the energy equation.

Thanks :)

wouter July 9, 2014 17:34

As i wrote I am no expert but I think this means phiv because of the "div(phiv,p)" but I have no clue what this means.

Hope someone else can take over
Wouter

alundilong July 10, 2014 19:25

Quote:

Originally Posted by harshad88 (Post 500792)
Thanks for your reply Wouter.

Could you also tell me what the meaning of fvc::absolute(phi/fvc::interpolate(rho), U) is? I cant understand what this terms corresponds to in the energy equation.

Thanks :)

fvc::absolute(phi/fvc::interpolate(rho), U) return absolute face flux.
if the mesh is moving, it will add up the contribution of moving mesh,
which mean the face flux is
phi/fvc::interpolate(rho) + fvc::meshPhi(U)
;
if static mesh, it will return phi/fvc::interpolate(rho)

Dan1788 July 10, 2014 22:07

Thanks Yijin, That was really helpful :)

massive_turbulence February 4, 2019 09:51

Quote:

Originally Posted by wouter (Post 500646)
Hello harshad88,

I am no expert.
It is part of a C or C++ construct A?b:c meaning
if A is true than b else c in this case c = "-dpdt"

hope this helps
Wouter

Simply called the "ternary operator" as part of C++.


All times are GMT -4. The time now is 19:03.