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/)
-   -   Liquid phase volume fraction (https://www.cfd-online.com/Forums/openfoam-solving/58624-liquid-phase-volume-fraction.html)

ngj August 7, 2008 13:50

It would probably be helpful i
 
It would probably be helpful if you did actually declare/read gamma from file.
/Niels

sega August 8, 2008 08:17

Ok, the tool is working now, b
 
Ok, the tool is working now, but I have to recompile each time I want to use another pair of lower and upper limits.

So, now I'm trying to make the tool work with the input from the shell.

>> liquidPhaseVolumeFraction . . -lowerLimit 0 -upperLimit 0.015 -time 0

or somethin like that..

>> liquidPhaseVolumeFraction . . 0 0.015 -time 0

I don't know how these user inputs are treated, but I tried by putting these lines into my code, which I have altered from the patchAverage.

argList::validArgs.append("lowerLimit");
argList::validArgs.append("upperLimit");

scalar lowerLimit(args.args()[3]);
scalar upperLimit(args.args()[4]);

Of course there are some problems regarding the classes:

DPOpt/liquidPhaseVolumeFraction.o
liquidPhaseVolumeFraction.C: In function 'int main(int, char**)':
liquidPhaseVolumeFraction.C:64: error: cannot convert 'const Foam::string' to 'Foam::scalar' in initialization
liquidPhaseVolumeFraction.C:65: error: cannot convert 'const Foam::string' to 'Foam::scalar' in initialization

It looks like upper and lower limits are read as strings from the shell. Trying to make the variables work inside the code as scalar does not seem to work.

So, where is the clue to read them from the shell as scalar, double or something similar and to be able to address the variables in the further code.

Thanks so far.
Greetings from rainy Germany.

sega August 8, 2008 08:21

Sorry, I have another question
 
Sorry, I have another question.

Niels, is your code calculating the phase fraction on the patch or on the whole 3D-domain (on the wedge in this case) ?

ngj August 21, 2008 05:58

The snippet calculates the vol
 
The snippet calculates the volume fraction for the entire domain, as the forAll(gamma,gI) loops over all internal cells.


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