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

How can I apply the bool function?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 1, 2014, 04:38
Default How can I apply the bool function?
  #1
Member
 
BO WANG
Join Date: Sep 2014
Posts: 37
Rep Power: 12
wang219910611 is on a distinguished road
Hi everyone,

I was trying to do myCavitatingFoam for the last few days. But I met some problem when I was trying to write the 0pEqn.

Following is my 0pEqn:

{
volScalarField pgl=(rhov*rhol*(rhov-rhol))/(magSqr(rhov)*psil-magSqr(rhol)*psiv);
if ( rho>rhol)

p=pSat+(B/N)*(pow((rho/rhol),N)-1.0);

else if (rho<rhov)

p=pSat*pow((rho/rhov),r);

else

p=pSat+pgl*log10(rhov*psil*(rhol+alphav*(rhov-rhol))/(rhol*(rhov*psil-alphav*(rhov*psil-rhol*psiv))));

}

Apparently, this is not in OpenFoam style. And the system told me that I should use a "bool" function instead.

Anybody has any idea of this? Any help will be appreciated.
wang219910611 is offline   Reply With Quote

Old   December 1, 2014, 04:56
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

surely people can try to guess but...

0. what is rho?
1. what is rhol?
2. what is rhov?

In fact the question is are they scalars or fields?
alexeym is offline   Reply With Quote

Old   December 1, 2014, 05:12
Smile
  #3
Member
 
BO WANG
Join Date: Sep 2014
Posts: 37
Rep Power: 12
wang219910611 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

surely people can try to guess but...

0. what is rho?
1. what is rhol?
2. what is rhov?

In fact the question is are they scalars or fields?
Thanks for the reply. I have checked their dimension again and found the mistake.

rho is the density, volScalarField
rhov is the gas density, dimensionedScalar(which should be volScalarField)
rhol is the liquid density, dimensionedScalar(which should be volScalarField)

Now the compile goes well. I'm going to test the solver with case now.
wang219910611 is offline   Reply With Quote

Reply

Tags
bool


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 121 June 11, 2021 11:05
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


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