CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   porousSimpleFoam creatfield (https://www.cfd-online.com/Forums/openfoam-programming-development/119683-poroussimplefoam-creatfield.html)

AmirBaqa1987 June 22, 2013 08:48

porousSimpleFoam creatfield
 
Hi everyone,
can any body say what do the following lines do in createfields?

Switch pressureImplicitPorosity(false);

int nUCorr = 0;
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCo rrectors"))
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCo rrectors")
);
}

if (nUCorr > 0)
{
pressureImplicitPorosity = true;
}
}

any help is appreciated
thanks
arjang

Lieven June 22, 2013 16:09

Hi argjang,


int nUCorr = 0; initialize nUCorr to 0
if (pZones.size()) checks if there are pZones (size > 0)
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCo rrectors")) checks if the nUCorrects keyword is present in the SIMPLE subdictionary of the solutionDict-file (system/fvSolutions)
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCo rrectors")
); If it is present, the (integer) value is read using the lookup function and stores it under nUCorr
}

if (nUCorr > 0) If nUCorr is bigger than 0, parameter pressureImplicitPorosity is set to true
{
pressureImplicitPorosity = true;
}
}

Hope this is what you liked to know.

Cheers,


Lieven


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