CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

multiPhaseEulerFoam and LES

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Display Modes
Old   June 1, 2012, 11:20
Default multiPhaseEulerFoam and LES
  #1
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 194
Rep Power: 17
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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)
    );
GerhardHolzinger is offline   Reply With Quote

Old   June 13, 2012, 15:19
Default
  #2
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 208
Rep Power: 13
kwardle is on a distinguished road
Gerhard,
That is correct. The turbulence part is based on the mixture only at this point.
-Kent
kwardle is offline   Reply With Quote

Old   December 18, 2013, 10:32
Default
  #3
New Member
 
AJ
Join Date: Sep 2013
Posts: 29
Rep Power: 5
Aj Nair is on a distinguished road
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.
Aj Nair is offline   Reply With Quote

Old   December 18, 2013, 11:10
Default
  #4
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 194
Rep Power: 17
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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.
kwardle likes this.
GerhardHolzinger is offline   Reply With Quote

Old   December 18, 2013, 13:07
Default
  #5
New Member
 
AJ
Join Date: Sep 2013
Posts: 29
Rep Power: 5
Aj Nair is on a distinguished road
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.
Aj Nair is offline   Reply With Quote

Old   December 18, 2013, 13:26
Default
  #6
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 194
Rep Power: 17
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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
GerhardHolzinger is offline   Reply With Quote

Old   December 18, 2013, 21:18
Default
  #7
New Member
 
AJ
Join Date: Sep 2013
Posts: 29
Rep Power: 5
Aj Nair is on a distinguished road
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 is offline   Reply With Quote

Old   December 18, 2013, 21:19
Default
  #8
New Member
 
AJ
Join Date: Sep 2013
Posts: 29
Rep Power: 5
Aj Nair is on a distinguished road
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.
Aj Nair is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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