CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   AlphaCourantNo code (https://www.cfd-online.com/Forums/openfoam-solving/119470-alphacourantno-code.html)

giack June 18, 2013 05:18

AlphaCourantNo code
 
Hi to all
I want to know how is calculated AlphaCourantNo so I look for the code and I find this lines.

if (mesh.nInternalFaces())
{
scalarField sumPhi
(
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
*fvc::surfaceSum(mag(phi))().internalField()
);

alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

}

My understanding of this piece of code is that for each cell it sums the face flux magnitudes, divides it by the cell volume and multiplies it with deltaT/2. The maximum over all cells is then the Courant number.
But I don't understand the meaning of this term:

pos(alpha1 - 0.01)*pos(0.99 - alpha1)

Anyone kwon the meaning of it?
Thank to all

pixarzhang May 25, 2014 09:07

Quote:

Originally Posted by giack (Post 434588)
Hi to all
I want to know how is calculated AlphaCourantNo so I look for the code and I find this lines.

if (mesh.nInternalFaces())
{
scalarField sumPhi
(
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
*fvc::surfaceSum(mag(phi))().internalField()
);

alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

}

My understanding of this piece of code is that for each cell it sums the face flux magnitudes, divides it by the cell volume and multiplies it with deltaT/2. The maximum over all cells is then the Courant number.
But I don't understand the meaning of this term:

pos(alpha1 - 0.01)*pos(0.99 - alpha1)

Anyone kwon the meaning of it?
Thank to all

I have the same question.Does anyone know the meaning?

danieldeising May 30, 2014 08:47

Hi enzhen,
this line
Code:

pos(alpha1 - 0.01)*pos(0.99 - alpha1)
gives you all cells where the volumetric phase fraction takes
values between 0.01 and 0.99.
And this piece of code
Code:

0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
is the definition of the Courant number in multiple dimensions,
assuming that the calculated velocity field is divergence free.

So as a result, you obtain a Courant number in the interfacial area.

Hope this helps,

Best,
Daniel

pixarzhang May 31, 2014 12:58

Quote:

Originally Posted by danieldeising (Post 494844)
Hi enzhen,
this line
Code:

pos(alpha1 - 0.01)*pos(0.99 - alpha1)
gives you all cells where the volumetric phase fraction takes
values between 0.01 and 0.99.
And this piece of code
Code:

0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
is the definition of the Courant number in multiple dimensions,
assuming that the calculated velocity field is divergence free.

So as a result, you obtain a Courant number in the interfacial area.

Hope this helps,

Best,
Daniel

thanks ~that does help


All times are GMT -4. The time now is 05:02.