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/)
-   -   Problems with volScalarField (https://www.cfd-online.com/Forums/openfoam-solving/60411-problems-volscalarfield.html)

niklas November 28, 2005 03:30

Why not? volScalarField pf =
 
Why not?
volScalarField pf = pow(10,25.0)*pow(max(0.0, alpha - alphaMax), 10.0);

different results?
does the pf field differ or what do you mean?

N

alberto November 28, 2005 13:42

I'm still working on twoPhaseE
 
I'm still working on twoPhaseEulerFoam to make granular pressure, radial distribution functions, and frictional stress models runtime selectable.

The problem happens with frictional stress models, where pf is the frictional pressure.

If I use the first piece of code, I get solution singularity at the second time step due to an abnormal value in the granular pressure, which is related to pf.
If I use the second piece of code, the calculation goes on regularly.
However, it seems the initialization of the pf field has some effect. I mean the forAll cycle doesn't seem to overwrite all initial values also in the second piece of code.

Alberto

alberto November 28, 2005 16:05

You were right. The problem wa
 
You were right. The problem was that I forgot the Foam::max(alpha-alphaMax, 0.0).

Thank you again

P.S. How are you?

Alberto :-)


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