|
[Sponsors] |
August 30, 2010, 01:58 |
|
#21 | |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
||
August 30, 2010, 02:11 |
|
#22 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
Ok .... Thanks
|
|
August 30, 2010, 03:05 |
|
#23 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
I can give you some hints which are not explained anywhere in the OF documentation (top secret! ), and are quite useful to carry around a lot of fields, as required in multiphase simulations.
Let's assume you have N phases. You will have to define: - N momentum equations (N velocity fields and N fvVectorMatrices) - N*(N-1)/2 interaction fields (meaning relative velocities, drag coefficients, ...) - N-1 phase fraction equations (assuming one fraction is computed as alpha_0 = 1-sum(alpha_i), i != 0. You will need N phase fraction fields for this. - 1 pressure equation based on the mixture As you can easily imagine, if N is arbitrary, coding this can be messy, if not done with proper care. You can collect your phase fields and equations (also objects if you want) for each property in a PtrList (http://foam.sourceforge.net/doc/Doxy..._1PtrList.html). I will give you an example for the relative velocity fields: First define: Code:
const nUr = N*(N-1)/2; Code:
PtrList<volScalarField> Ur(nUr); Code:
forAll (Ur, urI) { Ur.set ( urI, yourFieldInitialization ); } Code:
Ur[i]() The same operation can be done with equations: Code:
PtrList<fvVectorMatrix> UEqn(N); forAll (UEqn, uEqnI) { UEqn.set ( fvm::ddt(U()) + ... == ... ); } Code:
solve (UEqn[uEqnI]() == ...); Of course you can create a ptrList of the phaseModel object, and further simplify your work. If you decide to do this, I would suggest to incorporate alpha in the phaseModel, since it is currently not there, or you have an inconsistent syntax that becomes annoying with many phases. Last hint: since you are beginning with OpenFOAM from what I read, proceed step by step, and ask questions (poking me by email is allowed too, I do not bite , and I usually answer if I can). Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; August 30, 2010 at 03:06. Reason: Added link to doxygen |
|
August 30, 2010, 03:42 |
|
#24 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
thats clean .... i was about to write python programs to output the necessary files .... In that way , I can take the user input and just write out the files . However the approach requires the compilation of the source code evrytime you specify different number of components ....
|
|
August 30, 2010, 04:37 |
|
#25 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
No
You simply have to read the number of phases from a dictionary (label nPhases, being it integer), before allocating the PtrList objects ;-) Something similar is done in OF for the species in reacting solvers, and in multiphaseInterFoam, but in this last solver the implementation of what they called mixture class abuses a bit of C++ functionality, making the code quite unreadable (never a good idea!). Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
Tags |
bubble, bubblefoam, foam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Comparison of axisymmetric case, Starccm+ and OpenFOAM | linnemann | OpenFOAM Running, Solving & CFD | 12 | June 16, 2011 05:43 |
Need help to open an OpenFoam case with Paraviw | aaurouss | OpenFOAM | 2 | July 6, 2009 13:18 |
Validation Case | Ruben | Main CFD Forum | 0 | November 1, 2005 10:50 |
Validation case for turbulent flow | Ratan | Main CFD Forum | 0 | October 4, 2005 03:03 |
Validation case for turbulent flow | Ratan | Main CFD Forum | 0 | October 4, 2005 03:02 |