CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

one question about representation of equations?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 4 Post By marupio

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2011, 14:22
Default one question about representation of equations?
  #1
Member
 
lfgmarc's Avatar
 
Luis Felipe Gutierrez Marcantoni
Join Date: Oct 2010
Location: Cordoba-Argentina
Posts: 47
Rep Power: 15
lfgmarc is on a distinguished road
Send a message via MSN to lfgmarc
Hi, I am new in openFoam, and I try to understand this equation from XiFoam solver:

{
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
);
hEqn.relax();
hEqn.solve();

thermo.correct();
}

This is the enthalpy equation, I want to understand what is the meaning of each term, I understand that fvm::ddt(rho, h) is the representation of the time derivative, fvmDiv(phy,h) represent the convective term, but in this stage I am some confused about what is the meaning of the mvConvection->here, the next term is the diffusive term (fvm::laplacian(turbulence->alphaEff(), h)) here I am confused with the meaning of turbulence->alphaEff().

I will be a lot thankful if someone can explain me this.

thanks for your help

Best Regards
__________________
Felipe G
lfgmarc is offline   Reply With Quote

Old   June 30, 2011, 18:51
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
You have to remember, this is still C++ code. They've overloaded the operators and created namespaces in an elegant way so it looks like you are typing in an equation, but it is still just C++, and sometimes the syntax gets in the way a little.

Code:
+ mvConvection->fvmDiv(phi, h)
This whole thing is the convection term. Normally it would look something like:
Code:
+ fvm::div(phi, h)
but they are creating the convection scheme before the equation. Somewhere above this, you'll see where mvConvection gets created. This is not common, but there are reasons for this. The normal method would have OpenFOAM looking in your system/fvSchemes dictionary for a div(phi, h) scheme defined... then it would use that convection scheme. However, if only a specific convection scheme will do, it creates that one above the equation and forces the equation to use it. In this case, the user has no control over the convection scheme by changing the fvSchemes file.

Another reason for this may be because there are a lot of variables using a common convectionScheme... so rather than clutter up your fvSchemes file with entries for each variable, they define a common one, and only look that one up.

Code:
turbulence->alphaEff()
This is C++. turbulence is a pointer to a turbulenceModel, and the -> is the syntax we use to access the function alphaEff()... which basically just returns the effective alpha (I forget what alpha is in the world of turbulence). So this whole thing is simply the variable alphaEff().

Hope that helps.
marupio is offline   Reply With Quote

Old   June 30, 2011, 19:52
Default
  #3
Member
 
lfgmarc's Avatar
 
Luis Felipe Gutierrez Marcantoni
Join Date: Oct 2010
Location: Cordoba-Argentina
Posts: 47
Rep Power: 15
lfgmarc is on a distinguished road
Send a message via MSN to lfgmarc
Thanks for the reply David, was very helpful for me. Another question, the last term , DpDt is like an assignment ?

Best regards
__________________
Felipe G
lfgmarc is offline   Reply With Quote

Old   July 1, 2011, 19:57
Default
  #4
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
Originally Posted by marupio View Post
Code:
turbulence->alphaEff()
I forget what alpha is in the world of turbulence
alphaEff is the effective thermal diffusivity that uses the gradient diffusion hypothesis to relate the influence of turbulence on thermal diffusion through a turbulent Prandtl (Prt in OF set to 1 by default) and the turbulent viscosity calculated in your turbulence model. You can look in the compressible RANS models ($FOAM_SRC/turbulenceModels/compressible/RAS/) for alphat (turbulent thermal diffusivity) = mut/Prt. There is an explanation of the gradient diffusion hypothesis in here ..sorry...shameless plug. More detailed discussions are in books by Rodney Fox and Stephen Pope for those interested.

Dan
chegdan is offline   Reply With Quote

Old   July 2, 2011, 00:49
Default
  #5
Member
 
lfgmarc's Avatar
 
Luis Felipe Gutierrez Marcantoni
Join Date: Oct 2010
Location: Cordoba-Argentina
Posts: 47
Rep Power: 15
lfgmarc is on a distinguished road
Send a message via MSN to lfgmarc
thanks for your reply Dan
__________________
Felipe G
lfgmarc is offline   Reply With Quote

Old   July 2, 2011, 13:02
Default
  #6
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
Thanks Dan. Your article looks like a good read... relevant to my stuff, too.

Felipe, the last term DpDt isn't an assignment. It's the "equal to" operator. It behaves as an equals sign would in the equation you are creating.
marupio is offline   Reply With Quote

Old   August 18, 2011, 08:21
Default
  #7
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Quote:
Originally Posted by marupio View Post
Felipe, the last term DpDt isn't an assignment. It's the "equal to" operator. It behaves as an equals sign would in the equation you are creating.
Can you explain that a little more detailed? In another Thread (http://www.cfd-online.com/Forums/ope...tml#post206283) i found this one:
Quote:
DpDt = ddt(p) + U . grad(p)
Is the meaning of "behaves like an operator" and the statement in the last quote the same?

Thx, Alex

EDIT:
Just figured it out:
DpDt is the total differentiation Dp = dp/dt + dp/dx Dx + dp/dy Dy + dp/dz Dz divided by Dt. With Dx/Dt = u, Dy/Dt = v, ... the above equation follows. My Question now is: Where is the implementation of this operator? I had no success by searching in the User Guide and neither was there a found in the Programming Guide. I also found a table with most of the operators (e.g. ddt(p)) but no word about DpDt.

EDITē:
Found the implementation in createFields.H. The "find" command under linux seems to be very helpful in such cases =)

Last edited by derkermit; August 18, 2011 at 12:22.
derkermit is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
coupled source term in 3 transport equations mhassani OpenFOAM Running, Solving & CFD 1 September 10, 2018 10:35
2 Different Transonic Small Disturbance Equations? Frank Main CFD Forum 1 February 23, 2006 00:44
Solver Equations Carola CFX 9 August 12, 2003 09:27
Pressureless Euler-Poisson Equations Mikael Tushensson Main CFD Forum 0 April 12, 2001 21:18
Pictures and Equations? andy Main CFD Forum 3 December 11, 1998 10:51


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