# multiPhaseEulerFoam and LES

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 June 1, 2012, 11:20 multiPhaseEulerFoam and LES #1 Senior Member   Gerhard Holzinger Join Date: Feb 2012 Location: Austria Posts: 194 Rep Power: 17 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, fluid.phases(), iter) { phaseModel& phase = iter(); const volScalarField& alpha = phase; U += alpha*phase.U(); phi += fvc::interpolate(alpha)*phase.phi(); }``` Code: ```autoPtr sgsModel ( incompressible::LESModel::New(U, phi, fluid) );```

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

 December 18, 2013, 10:32 #3 New Member   AJ Join Date: Sep 2013 Posts: 29 Rep Power: 5 GerhardHolzinger Can you say how this part of program works multiphaseSystem fluid(U, phi); forAllIter(PtrDictionary, 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: 194 Rep Power: 17 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.

 December 18, 2013, 13:07 #5 New Member   AJ Join Date: Sep 2013 Posts: 29 Rep Power: 5 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: 194 Rep Power: 17 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

 December 18, 2013, 21:18 #7 New Member   AJ Join Date: Sep 2013 Posts: 29 Rep Power: 5 GerhardHolzinger thank you, Sorry to bother you i have 1 more doubt when i run this part forAllIter(PtrDictionary, 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, fluid.phases(), iter) ^ createFields.H:145:55: error: ‘iter’ was not declared in this scope forAllIter(PtrDictionary, 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, 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 New Member   AJ Join Date: Sep 2013 Posts: 29 Rep Power: 5 GerhardHolzinger thank you, Sorry to bother you i have 1 more doubt when i run this part forAllIter(PtrDictionary, 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, fluid.phases(), iter) ^ createFields.H:145:55: error: ‘iter’ was not declared in this scope forAllIter(PtrDictionary, 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, 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.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

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

 Contact Us - CFD Online - Top