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

the difference between rho() and rho_ and rho?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2020, 07:22
Question the difference between rho() and rho_ and rho?
  #1
Senior Member
 
kimy
Join Date: Mar 2019
Location: https://t.me/pump_upp
Posts: 164
Rep Power: 7
qi.yang@polimi.it is on a distinguished road
Send a message via ICQ to qi.yang@polimi.it Send a message via AIM to qi.yang@polimi.it Send a message via Yahoo to qi.yang@polimi.it
Hi guys,

please help me to understand why in the k-epsilon source code there are so many simbols which may represent the same thing. For example, rho() and rho_ and rho. What do they mean?

tmp<fvScalarMatrix> epsEqn
(
fvm::ddt(alpha, rho, epsilon_)
+ fvm::div(alphaRhoPhi, epsilon_)
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
==
C1_*alpha()*rho()*G*epsilon_()/k_()
//- fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha()*rho()*divU, epsilon_)
- fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
+ epsilonSource()
+ fvOptions(alpha, rho, epsilon_)
);

Thanks!
qi.yang@polimi.it is offline   Reply With Quote

Old   February 13, 2020, 17:28
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
- Wherever you see a tailing underscore in OF source code, that means the object is 'local' to the class.
- rho is 'volScalarField' type object for fluid density. This object includes 'internalField' and 'boundaryField' info.
- rho() in the source terms is 'volScalarField::Internal' type object wherein the boundary information is absent. This is fairly new functionality, and it is useful to reduce computational costs for parallel computations by reducing parallel communications which are mostly needed for boundaryFields rather than internalFields.

For a given 'vol*Field', say 'Object', '()' operator is defined, and you can call it by appending it to the given field, like 'Object()'. This 'Internal' field is only usable for sources on the right hand side of a constructed equation.
lpz456 likes this.
HPE is offline   Reply With Quote

Old   February 14, 2020, 04:30
Question
  #3
Senior Member
 
kimy
Join Date: Mar 2019
Location: https://t.me/pump_upp
Posts: 164
Rep Power: 7
qi.yang@polimi.it is on a distinguished road
Send a message via ICQ to qi.yang@polimi.it Send a message via AIM to qi.yang@polimi.it Send a message via Yahoo to qi.yang@polimi.it
Quote:
Originally Posted by HPE View Post
- Wherever you see a tailing underscore in OF source code, that means the object is 'local' to the class.
- rho is 'volScalarField' type object for fluid density. This object includes 'internalField' and 'boundaryField' info.
- rho() in the source terms is 'volScalarField::Internal' type object wherein the boundary information is absent. This is fairly new functionality, and it is useful to reduce computational costs for parallel computations by reducing parallel communications which are mostly needed for boundaryFields rather than internalFields.

For a given 'vol*Field', say 'Object', '()' operator is defined, and you can call it by appending it to the given field, like 'Object()'. This 'Internal' field is only usable for sources on the right hand side of a constructed equation.
Thanks. So if I write rho(), rho or rho_ will lead the results different only in the boundary?
qi.yang@polimi.it is offline   Reply With Quote

Old   February 14, 2020, 16:16
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
What do you mean by "results"? These objects are implementation details, and allowing tricks to reduce comp costs. Apart from that, all three objects represent the same information eventually: fluid density.
HPE is offline   Reply With Quote

Reply

Tags
turbulence model


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
Converging Diverging Nozzle with dbnsTurbFoam Saleh Abuhanieh OpenFOAM Running, Solving & CFD 4 December 13, 2019 11:26
rho and rhoFinal in fvSolution and others NewKid OpenFOAM Running, Solving & CFD 3 July 15, 2019 10:36
rSF: p divergence in combustor (wt negative value) zonda OpenFOAM Pre-Processing 4 April 10, 2018 07:59
what does this verbose error mean? immortality OpenFOAM Running, Solving & CFD 1 February 6, 2013 17:47
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34


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