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/)
-   -   multiPhaseEulerFoam and LES (https://www.cfd-online.com/Forums/openfoam-solving/102762-multiphaseeulerfoam-les.html)

GerhardHolzinger June 1, 2012 11:20

multiPhaseEulerFoam and LES
 
Dear foamers,

is it correct, that multiPhaseEulerFoam calculates the large eddy model for the mixture?

The reason for this assumption of mine lies in the following parts of code:

Code:

multiphaseSystem fluid(U, phi);

    forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
    {
        phaseModel& phase = iter();
        const volScalarField& alpha = phase;

        U += alpha*phase.U();
        phi += fvc::interpolate(alpha)*phase.phi();
    }

Code:

autoPtr<incompressible::LESModel> sgsModel
    (
        incompressible::LESModel::New(U, phi, fluid)
    );


kwardle June 13, 2012 15:19

Gerhard,
That is correct. The turbulence part is based on the mixture only at this point.
-Kent

Aj Nair December 18, 2013 09:32

GerhardHolzinger Can you say how this part of program works
multiphaseSystem fluid(U, phi);
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{
phaseModel& phase = iter();
const volScalarField& alpha = phase;
U += alpha*phase.U();
hi += fvc::interpolate(alpha)*phase.phi();
}


This part is really confusing me, as i guess iter is equivalent iteration number(correct me if i am wrong)
So how come it's value can be assigned to phase.

GerhardHolzinger December 18, 2013 10:10

You mix up two completely different things.

The variable iter in the source code has nothing to do with an iteration in the CFD context. In order to understand the source code you have to be familiar with some concepts of object-oriented programming. OF is programmed in C++ and makes heavy use of object-orientation and other advanced programming techniques. This makes it, unfortunately, hard for beginners to understand what OF is doing.

As multiphaseEulerFoam supports an arbitrary number of phases, let's call this number n, multiphaseEulerFoam uses a list to store the n phases. When solving the n equations the solver iterates over this list of phases. For this purpose object-oriented programming languages offer lists and iterators to make the life for the developers easier.

So iter is an iterator that iterates of the list of phases and represents the current element of this list.

Aj Nair December 18, 2013 12:07

Thanks a lot GerhardHolzinger.
i just want to know how to familiarize with these terms, i could see lot of terms in abbreviated format in OF. can you suggest me any material, so that i can refer that in case of doubt related to these abbreviations.
P.S.> can you say what term is used to represent number of iteration.

GerhardHolzinger December 18, 2013 12:26

To familiarize yourself with the terms and concepts of object-oriented programming any book on C++ can be used. You could read any book on object-oriented programming, however, as OpenFOAM is written in C++ it is obvious to choose C++ as programming language.

Important programming-concepts that are used by OpenFOAM
  • Objects and classes
  • Abstract classes and inhertitance
  • Generic programming and templates
  • Data structures, such as lists

Aj Nair December 18, 2013 20:18

GerhardHolzinger thank you, Sorry to bother you i have 1 more doubt when i run this part
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) { phaseModel& phase = iter(); I am getting error as following mya i know why ??

CreateFields.H:145:1: note: in expansion of macro ‘forAllIter’
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
createFields.H:145:55: error: ‘iter’ was not declared in this scope
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
/opt/openfoam222/src/OpenFOAM/lnInclude/UList.H:417:9: note: in definition of macro ‘forAllIter’
iter != (container).end(); \
^
createFields.H:145:39: error: ‘fluid’ was not declared in this scope
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
/opt/openfoam222/src/OpenFOAM/lnInclude/UList.H:417:18: note: in definition of macro ‘forAllIter’
iter != (container).end();
\
i could see in Peqn and Ueqn, they had used without declaring anything for this macro.

Aj Nair December 18, 2013 20:19

GerhardHolzinger thank you, Sorry to bother you i have 1 more doubt when i run this part

forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{
phaseModel& phase = iter()
;

I am getting error as following may i know why ??

CreateFields.H:145:1: note: in expansion of macro ‘forAllIter’
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
createFields.H:145:55: error: ‘iter’ was not declared in this scope
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
/opt/openfoam222/src/OpenFOAM/lnInclude/UList.H:417:9: note: in definition of macro ‘forAllIter’
iter != (container).end(); \
^
createFields.H:145:39: error: ‘fluid’ was not declared in this scope
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
^
/opt/openfoam222/src/OpenFOAM/lnInclude/UList.H:417:18: note: in definition of macro ‘forAllIter’
iter != (container).end();
\
i could see in Peqn and Ueqn, they had used without declaring anything for this macro.


All times are GMT -4. The time now is 14:20.