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

bubbleFoam validation case

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2010, 01:58
Default
  #21
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by balkrishna View Post
Thanks for the link .... Can i get the source code of the solver ?? The implementation of the algorithm is the tough aspect in OpenFOAM .....
Try to contact the Authors of the paper. I believe the code was not released, and it is surely not part of OpenFOAM and OpenFOAM-dev/-ext.

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.
alberto is offline   Reply With Quote

Old   August 30, 2010, 02:11
Default
  #22
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Ok .... Thanks
balkrishna is offline   Reply With Quote

Old   August 30, 2010, 03:05
Default
  #23
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by balkrishna View Post
Ok .... Thanks
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;
You can define
Code:
PtrList<volScalarField> Ur(nUr);
Then, each field has to be actually initialized with
Code:
forAll (Ur, urI)
{
    Ur.set
    (
       urI,
       yourFieldInitialization
    );
}
To access the relative velocity of index i, you simply have to use

Code:
Ur[i]()
Note the (), because you are actually working with a PtrList now, so you have to invoke the corresponding method that returns the field (or a reference to it)!

The same operation can be done with equations:

Code:
PtrList<fvVectorMatrix> UEqn(N);

forAll (UEqn, uEqnI)
{
    UEqn.set
    (
         fvm::ddt(U())
      + ...
      ==
         ...
    );
}
To solve, you loop again over the PtrList, and for each equation, you have to do

Code:
solve (UEqn[uEqnI]() == ...);
More good news! If you consider twoPhaseEulerFoam, instead than bubbleFoam, which is actually a bit more ready to be extended to N phases, you will notice that all the properties of a phase are collected in the phaseModel object.
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,
sharonyue likes this.
__________________
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
alberto is offline   Reply With Quote

Old   August 30, 2010, 03:42
Default
  #24
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
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 ....
balkrishna is offline   Reply With Quote

Old   August 30, 2010, 04:37
Default
  #25
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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.
alberto is offline   Reply With Quote

Reply

Tags
bubble, bubblefoam, foam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


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


All times are GMT -4. The time now is 00:24.