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 Members List Search Today's Posts Mark Forums Read

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
Member
 
yangqi
Join Date: Mar 2019
Posts: 35
Rep Power: 2
qi.yang@polimi.it is on a distinguished road
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
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
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.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 14, 2020, 04:30
Question
  #3
Member
 
yangqi
Join Date: Mar 2019
Posts: 35
Rep Power: 2
qi.yang@polimi.it is on a distinguished road
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
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
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.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Reply

Tags
turbulence model

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
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 09:11.