|
[Sponsors] |
June 1, 2012, 12:20 |
multiPhaseEulerFoam and LES
|
#1 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
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) ); |
|
June 13, 2012, 16:19 |
|
#2 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
Gerhard,
That is correct. The turbulence part is based on the mixture only at this point. -Kent |
|
December 18, 2013, 10:32 |
|
#3 |
Member
AJ
Join Date: Sep 2013
Posts: 30
Rep Power: 13 |
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. |
|
December 18, 2013, 11:10 |
|
#4 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
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. |
|
December 18, 2013, 13:07 |
|
#5 |
Member
AJ
Join Date: Sep 2013
Posts: 30
Rep Power: 13 |
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. |
|
December 18, 2013, 13:26 |
|
#6 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
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
|
|
December 18, 2013, 21:18 |
|
#7 |
Member
AJ
Join Date: Sep 2013
Posts: 30
Rep Power: 13 |
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. |
|
December 18, 2013, 21:19 |
|
#8 |
Member
AJ
Join Date: Sep 2013
Posts: 30
Rep Power: 13 |
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. |
|
|
|