# one question about representation of equations?

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

 June 30, 2011, 13:22 one question about representation of equations? #1 Member     Luis Felipe Gutierrez Marcantoni Join Date: Oct 2010 Location: Cordoba-Argentina Posts: 47 Rep Power: 9 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

 June 30, 2011, 17:51 #2 Senior Member   David Gaden Join Date: Apr 2009 Location: Winnipeg, Canada Posts: 436 Rep Power: 15 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. francescomarra, zhernadi, neiht and 1 others like this.

 June 30, 2011, 18:52 #3 Member     Luis Felipe Gutierrez Marcantoni Join Date: Oct 2010 Location: Cordoba-Argentina Posts: 47 Rep Power: 9 Thanks for the reply David, was very helpful for me. Another question, the last term , DpDt is like an assignment ? Best regards __________________ Felipe G

July 1, 2011, 18:57
#4
Senior Member

Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 613
Rep Power: 22
Quote:
 Originally Posted by marupio 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

 July 1, 2011, 23:49 #5 Member     Luis Felipe Gutierrez Marcantoni Join Date: Oct 2010 Location: Cordoba-Argentina Posts: 47 Rep Power: 9 thanks for your reply Dan __________________ Felipe G

 July 2, 2011, 12:02 #6 Senior Member   David Gaden Join Date: Apr 2009 Location: Winnipeg, Canada Posts: 436 Rep Power: 15 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.

August 18, 2011, 07:21
#7
Member

A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 8
Quote:
 Originally Posted by marupio 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 11:22.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post mhassani OpenFOAM Running, Solving & CFD 0 February 26, 2011 05:14 Frank Main CFD Forum 1 February 23, 2006 00:44 Carola CFX 9 August 12, 2003 08:27 Mikael Tushensson Main CFD Forum 0 April 12, 2001 20:18 andy Main CFD Forum 3 December 11, 1998 10:51

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