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

calcAlphas() of multiphaseSystem

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

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Display Modes
Old   March 12, 2014, 05:43
Default calcAlphas() of multiphaseSystem
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 159
Rep Power: 5
maybee is on a distinguished road
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<phaseModel>, 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
maybee is offline   Reply With Quote

Old   March 12, 2014, 05:50
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 166
Rep Power: 14
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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.
GerhardHolzinger is offline   Reply With Quote

Old   March 12, 2014, 06:05
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 159
Rep Power: 5
maybee is on a distinguished road
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?
maybee is offline   Reply With Quote

Old   March 12, 2014, 06:32
Default
  #4
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 166
Rep Power: 14
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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
File Type: jpg damBreak4phase.jpg (18.3 KB, 13 views)
maybee likes this.
GerhardHolzinger is offline   Reply With Quote

Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiphaseEulerFoam: PtrDictionary<phaseModel> phases_ of multiphasesystem fluid maybee OpenFOAM Programming & Development 9 January 27, 2014 07:24
method solve() of class multiphasesystem maybee OpenFOAM Programming & Development 2 December 14, 2013 12:55


All times are GMT -4. The time now is 22:47.