|
[Sponsors] |
multiphaseInterFoam - creation of the phases in MultiphaseMixture and the iNew class |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 19, 2017, 05:38 |
multiphaseInterFoam - creation of the phases in MultiphaseMixture and the iNew class
|
#1 |
New Member
Join Date: Jan 2012
Posts: 9
Rep Power: 14 |
Hi all. I'm trying to understand the details of the multiphaseInterFoam solver.
My aim is to modify the explicit density based solver dbnsFoam of the extend project for use of a mixture of arbitrarily many compressible materials with Mie-Gruneisen type equation of state (no viscosity, no contact angle stuff etc., very simple), and i hope i can use a datastructure similar to the MultiphaseMixture class of multiphaseInterFoam. In the MultiphaseMixture class I just can't figure out how and when the phases in the phases_ PtrDictionary are created. In the phase.H header i stumble over the definition of the nested class iNew: Code:
//- Return a pointer to a new phase created on freestore // from Istream class iNew { const volVectorField& U_; const surfaceScalarField& phi_; public: iNew ( const volVectorField& U, const surfaceScalarField& phi ) : U_(U), phi_(phi) {} autoPtr<phase> operator()(Istream& is) const { dictionaryEntry ent(dictionary::null, is); return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_)); } }; I gess the creation of the phase objects is done in the constructor of MultiphaseMixture, where the constructor for the phases_ PtrDictionary is called in the line Code:
phases_(lookup("phases"), phase::iNew(U, phi)), What i suppose is: the lookup("phases") command gives back the list of dictionaries for the properties of the component phases, which are read from the transportProperties dictionary. But i only see a call of the iNew contructor which of course gives back an object of type iNew, but i can find nowhere a definition of a constructor of a PtrDictionary which takes an argument of type phase::iNew or something like that. Nor do i find a call of iNew:: operator()(Istream& is), as mentioned. I tried to find out by going through the damBrek4phase tutorial case step by step with a debugger, but didn't manage to get it done right. Can anybody explain what i'm getting wrong? Since this mechanism with iNew is also used in other solvers, i think it would be worth the time making clear how it works. Last edited by koderer; July 20, 2017 at 04:10. |
|
September 17, 2017, 00:46 |
|
#2 | |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16 |
Quote:
Hi, I want to manipulate multiphaseInterFoam so I need to have a deep understanding about the criteria of the code. Would you please let me know if you know any paper which the code is written based on it? Cheers, Elham |
||
September 21, 2017, 07:19 |
|
#3 |
New Member
Join Date: Jan 2012
Posts: 9
Rep Power: 14 |
multiphaseInterFoam is interFoam with some additional features, e.g. an arbitrary number n of phases instead of only 2. I think some things in interFoam are explaned in the PhD thesis of Ubbink (i didn't read it thoroughly, i must admit).
|
|
September 22, 2017, 06:03 |
constructor
|
#4 |
Member
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12 |
Hi
If you take a look at doxygen (https://cpp.openfoam.org/v5/classFoa...b457a9b01e2c06) the answer is in PtrDictionary constructor which is: Code:
PtrDictionary ( Istream & is, const INew & iNew ) I have a problem in alpha gradient definition (Alpha gradient definition in multiphaseInterFoam ?!). I'll be appreciated if you can share your info. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|