# calcAlphas() of multiphaseSystem

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

 March 12, 2014, 05:43 calcAlphas() of multiphaseSystem #1 Senior Member   Join Date: Jan 2012 Posts: 159 Rep Power: 6 hi, I don`t understand method calcAlphas() of multiphaseSystem Code: void Foam::multiphaseSystem::calcAlphas() 48 { 49 scalar level = 0.0; 50 alphas_ == 0.0; 51 52 forAllIter(PtrDictionary, phases_, iter) 53 { 54 alphas_ += level*iter(); //volScalarField alphas_ 55 level += 1.0; 56 } 57 58 alphas_.correctBoundaryConditions(); 59 } By the "forAllIter" Macro we iterate through all objects of type "phaseModel" which should be the phasefractions of the different phases in first place, right? If this is right I don`t understand what is calculated with this procedure. As far as I understand line 54 would technically mean the following Code: volScalarField alphas_ = phasefraction1*0 + phasefraction2*1 + phasefraction3*2 ... Initially I thought volScalarField alphas_ would just be the sum of all phasefraction fields of the different phases, but when I look at the code it does not seem so. What is calculated here? greetings maybee

 March 12, 2014, 05:50 #2 Senior Member   Gerhard Holzinger Join Date: Feb 2012 Location: Austria Posts: 195 Rep Power: 17 The sum of the volume fractions of all phases must be 1. There is little information in field that is 1 throughout the domain. The intention behind alphas is to provide one field to visualize all phases. If you have a water-oil-air system, you have three volume fraction fields. Three fields are hard to visualize in one image. This is where alphas comes to the rescue. In the alphas field 0 means water, 1 means oil and 2 means air. This way you can depict all phases at once.

 March 12, 2014, 06:05 #3 Senior Member   Join Date: Jan 2012 Posts: 159 Rep Power: 6 Thx, nice idea, but I am thinking about the following now: Let s assume we have initial water-oil-air alpha fields like Code: water ( 1 1 1 1 0 0 0 ) oil ( 0 0 0 0 0.3 0.5 0.7 ) air ( 0 0 0 0 0.7 0.5 0.3 ) So, the resulting volScalarField alphas_ would be something like Code: alphas_ ( 0 0 0 0 1*0.3 + 2*0.7 = 1.7 1*0,5 + 2*0.5 = 1.5 1*0.7 + 2*0.3 = 1.3 ) Your visualization theory in which 0 is water, 1 is oil and 2 is air would only work if each cell is initially full of water OR oil OR air, right? Isn`t this some kind of limitating at least the intitial conditions of the cells if only 0 or 1 for each phase in a cell were possible?

March 12, 2014, 06:32
#4
Senior Member

Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 195
Rep Power: 17
Yes, you can have values in between. I attached the alphas field from the damBreak4phase tutorial case of multiphaseEulerFoam.

The phases are water-oil-mercury-air.

If you have any doubts or ideas. Play with the tutorial case.
Attached Images
 damBreak4phase.jpg (18.3 KB, 16 views)

 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

 Similar Threads Thread Thread Starter Forum Replies Last Post maybee OpenFOAM Programming & Development 9 January 27, 2014 07:24 maybee OpenFOAM Programming & Development 2 December 14, 2013 12:55

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