CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to read the phaseName: alpha.water from the code (https://www.cfd-online.com/Forums/openfoam/164543-how-read-phasename-alpha-water-code.html)

shipman December 25, 2015 03:18

How to read the phaseName: alpha.water from the code
 
Dear All,

Maybe it is a bit boring question but I just wondered that how the code read the alpha1 phaseName as alpha.water in the compressibleInterFoam solver?

When I looked at the code, I could not see anywhere alpha1 phaseName assigned as alpha.water.

First I looked at createFields where alpha1 is seen:

Code:

Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
twoPhaseMixtureThermo mixture(mesh);

volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());


then looked at twoPhaseMixtureThermo.H which in inherited twoPhaseMixute:

Code:

class twoPhaseMixtureThermo
:
    public psiThermo,
    public twoPhaseMixture

When I checked the twoPhaseMixture.H file:

Code:

class twoPhaseMixture
{
protected:

    // Protected data

        word phase1Name_;
        word phase2Name_;

        volScalarField alpha1_;
        volScalarField alpha2_;

Finally Phase names are defined in twoPhaseMixture.C file as follows:

Code:

phase1Name_(wordList(dict.lookup("phases"))[0]),
    phase2Name_(wordList(dict.lookup("phases"))[1]),

    alpha1_
    (
        IOobject
        (
            IOobject::groupName("alpha", phase1Name_),
            mesh.time().timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    ),

    alpha2_
    (
        IOobject
        (
            IOobject::groupName("alpha", phase2Name_),
            mesh.time().timeName(),
            mesh
        ),
        1.0 - alpha1_
    )


So, my question is how the alpha.water is assigned to name of alpha1?

I may overlook something. :(

Thank you

shipman December 25, 2015 03:42

Ok sorry for boring question. I found it finally. It reads from const/thermophyPro dic.

cyw August 23, 2018 04:35

Quote:

Originally Posted by shipman (Post 578655)
Ok sorry for boring question. I found it finally. It reads from const/thermophyPro dic.

Hello, where did you find it? I cannot find the dict in the code.


All times are GMT -4. The time now is 04:12.