CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

multiphaseEulerFoam: method iter() and calculation of phase fractions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2013, 08:22
Default multiphaseEulerFoam: method iter() and calculation of phase fractions
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,
I have a few questions about the multiphaseEuler solver:

1. Within the main method of the solvers .C file there is the file "createFields.H" included. Within this file can be found
Code:
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)     
    {
        phaseModel& phase = iter();                 

        const volScalarField& alpha = phase;    

        U += alpha*phase.U();  

        phi += fvc::interpolate(alpha)*phase.phi();  
   }
with the method iter():

Code:
inline Foam::label Foam::cloudSolution::iter() const   //Return const access to the current 
                                                                //cloud iteration.
{
return iter_;   //label iter_;  //- Current cloud iteration
}
I assume that alpha is one phase fraction, right?
Furthermore alpha is a reference to iter() which means a reference to the variable iter_ . But, what is iter_ exactly?

2. After the solvers loop is started later in the main method with "while (runTime.run())" at which point are the phase fractions calculated and saved?

greetings
maybee
maybee is offline   Reply With Quote

Old   July 22, 2020, 08:20
Default
  #2
New Member
 
Elol
Join Date: Feb 2020
Posts: 16
Rep Power: 6
Elol is on a distinguished road
Hi Foamers,

I have almost the same question as I don't fully unterstand what is the iter(). I have the following piece of code which I am trying to understand
Code:
void Foam::multiphaseDriftMixture::calcAlphas()
{
    alphas_ == 0.0;

    forAllIter(PtrDictionary<phaseDrift>, phasesk_, iter) //Iterate across all elments in the Phasesk_ (transport prorties) which is type from PtrDictionary<phaseDrift>
    {
        alphas_ += iter(); // alphas_ = alphas_ + iter()
    }
}
what i understand that the for loop is looping on the Container type (phase drift dictionary) and phasesk contatiner and iter. alphas_ starts with 0.0 + iter()
what is the iter()?
Elol is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:35.