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/)
-   -   can I delete this piece of code from the twoPhaseEulerFoam? (https://www.cfd-online.com/Forums/openfoam-programming-development/146120-can-i-delete-piece-code-twophaseeulerfoam.html)

sharonyue December 18, 2014 17:39

can I delete this piece of code from the twoPhaseEulerFoam?
 
Hi guys,

In twoPhaseEulerFoam , we see:
Code:

while (pimple.loop())
        {
            fluid.solve();
          fluid.correct();

            volScalarField contErr1

I looked into the code, it returns like this:
Code:

void Foam::diameterModel::correct()
{}

So I think it calculates nothing....so why add this here? Im confused. Any ideas? Thanks,

alexeym December 19, 2014 10:16

Hi,

If you take a look at description of the class

Code:

Class
    Foam::diameterModel
       
Description
    A2stract base-class for dispersed-phase particle diameter models.

you'll see that you should look at correct method in children of diameterModel class, such as IATE. In this class correct method is not so short.

anuragm January 20, 2015 05:59

Hi Alexey,

I have a similar question about fluid.correct() and I do not follow your answer. Could you please explain it a little more?

Thanks

ron_OFuser January 20, 2015 06:22

Anurag, You need to dig into that. The function is a member of the referred base class. :cool:

alexeym January 20, 2015 07:25

Hi,

Quote:

Originally Posted by anuragm (Post 528285)
I have a similar question about fluid.correct() and I do not follow your answer. Could you please explain it a little more?

Well, you can start with ron_OFuser's answer.

More detailed version is: what is fluid? It is variable of type twoPhaseSystem defined in createFields.H:

Code:

twoPhaseSystem fluid(mesh, g);
correct method of twoPhaseSystem does this:

Code:

void Foam::twoPhaseSystem::correct()
{
    phase1_.correct();
    phase2_.correct();
}

what are phase1_ and phase2_? They are properties of twoPhaseSystem of type phaseModel:

Code:

class twoPhaseSystem
:
    public IOdictionary
{
...
        //- Phase model 1
        phaseModel phase1_;
...
}

What correct method of phaseModel does? It calls correct method of dPtr_

Code:

void Foam::phaseModel::correct()
{
    return dPtr_->correct();
}

and dPtr_ is a pointer to diameter model

Code:

class phaseModel
:
    public volScalarField,
    public transportModel
{
...
        //- Diameter model
        autoPtr<diameterModel> dPtr_;
...
}

Currently there are 3 diameter models in twoPhaseSystem:

Code:

constantDiameter
isothermalDiameter
IATE

First two models really have empty correct method. The last however has non-empty correct method.

Is it a little bit more clear this time?

anuragm January 22, 2015 20:15

Many thanks for the detailed explanation. I really appreciate it.


All times are GMT -4. The time now is 08:24.