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/)
-   -   incompressibleTwoPhaseMixture call/constructor (https://www.cfd-online.com/Forums/openfoam-solving/127023-incompressibletwophasemixture-call-constructor.html)

chrisb2244 December 1, 2013 22:10

incompressibleTwoPhaseMixture call/constructor
 
Hi,

I'm working on modifying the interFoam solver (OpenFoam 2.2.2 if it makes any difference?) and am currently reading through the (unmodified) source files and using the Doxygen documentation to try and gain some understanding.

I'm a little confused by the incompressibleTwoPhaseMixture constructor(?) in createFields.H

The section in question reads

Code:

Info<< "Reading transportProperties\n" << endl;
    incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);

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

    const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
    const dimensionedScalar& rho2 = twoPhaseProperties.rho2();

and having found the constructor information, it seems that it requires U, phi, alpha1 and alpha2, with defaults for alpha1 and alpha2 if they're not specified.

Code:


// Constructors

        //- Construct from components
        incompressibleTwoPhaseMixture
        (
            const volVectorField& U,
            const surfaceScalarField& phi,
            const word& alpha1Name = "alpha1",
            const word& alpha2Name = "alpha2"
        );

This would be fine, but the call has no brackets around the other terms. How is it using the terms that follow, and if those are separate, what is "twoPhaseProperties" all about? The documentation just links to the createFields.H file and gives me the lines that I put in the first code box.

If someone could explain how this is working, I'd appreciate it very much.

(On a side note, there isn't a namespace using statement in createFields.H. Does this work because Foam::incompressibleTwoPhaseMixture::incompressibl eTwoPhaseMixture is the only possible call for that?)

Thanks,

Christian


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