CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   incompressibleTwoPhaseInteractingMixture implementation (https://www.cfd-online.com/Forums/openfoam-programming-development/176089-incompressibletwophaseinteractingmixture-implementation.html)

desanga August 10, 2016 20:01

incompressibleTwoPhaseInteractingMixture implementation
 
Hi Foamers,

I have a question to ask you. This isn't directly related to CFD but its about C++ implementation of incompressibleTwoPhaseInteractingMixture.H (applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/).

As you can see inside incompressibleTwoPhaseInteractingMixture.H, this is a derived class from three base classes ( public IOdictionary,public transportModel,
public twoPhaseMixture). The constructor of this class is implemented as below ( incompressibleTwoPhaseInteractingMixture.C).

Foam::incompressibleTwoPhaseInteractingMixture::
incompressibleTwoPhaseInteractingMixture
(
const volVectorField& U,
const surfaceScalarField& phi
)
:
IOdictionary
(
IOobject
(
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
twoPhaseMixture(U.mesh(), *this),

it only invokes the constructors of IOdictionary, twoPhaseMixture. As long as I know, we should call all the base class constructors inside the constructor of the derived class. There is no sign of transportModel class constructor (transportModel.H does not have any default constructors). This is the original code inside driftfluxFoam and it compiles without any errors.I think, I have missed something here. Do you guys have some explanation to matter? :)

Thanks in advance

Tobi August 12, 2016 12:14

Hi,

a) you do not give any information about which foam version you are using (http://www.cfd-online.com/Forums/ope...tml#post613817)

b) the next time it would be better to use code tags

c) In the latest release (Foundation 4.x) the class you mentioned inherits everything from these classes:

Code:

class incompressibleTwoPhaseInteractingMixture
:
    public IOdictionary,
    public compressibleTransportModel,
    public twoPhaseMixture
{

and the constructor call that you miss for the compressibleTransportModel is:
Code:

    // Constructors

        //- Construct from components
        compressibleTransportModel
        ();

It does not take any argument and hence you do not need to call it. Hence, the world is fine :)


All times are GMT -4. The time now is 21:35.