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

multiPhaseEulerFoam extract phase fractions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2021, 12:08
Default multiPhaseEulerFoam extract phase fractions
  #1
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 551
Rep Power: 16
Simbelmynė is on a distinguished road
Hi,


I wish to extract the phase fractions and modify a scalar field (tracer) according to some custom range of one of the phases (air in this case). First I tried a "forAll(alpha.air, i)" and variations of it but that did not work. I got some hints from createFields.H and zonePhaseVolumes.H though and put together something that works. Not sure if this is efficient though.

So my question is if I can do it in a better way?


Code:
        forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
        {
            phaseModel& phase = iter();
            const volScalarField& alpha = phase;
            
              
            forAll(alpha,i)
            {
                // Check for 10 % air (must be primary phase)
                // However, ignore cells with more than 90 % air            
                if ( (alpha[i] > 0.1) && (alpha[i] < 0.9) )
                {
                    tracer[i] = 1.0; // just a function object scalar
                }
            }
            
        }
Simbelmynė is offline   Reply With Quote

Old   April 3, 2023, 05:44
Default
  #2
New Member
 
yuming_shao
Join Date: Nov 2022
Posts: 3
Rep Power: 3
yuming_shao is on a distinguished road
Did you succeed? I have the same problem
yuming_shao is offline   Reply With Quote

Reply


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
how to define reaction happen in specific phase with multiphaseEulerFoam tubulence-IO OpenFOAM Running, Solving & CFD 0 December 30, 2020 02:26
phase diameter and phase compressibility in multiphaseEulerFoam solver mike.franky OpenFOAM Running, Solving & CFD 7 May 20, 2020 10:45
Scalar transport in one phase (multiphaseEulerFoam) Simbelmynė OpenFOAM 0 November 29, 2019 07:23
UDF for modifying density of mixture phase during the calculating process sola86 Fluent UDF and Scheme Programming 2 May 28, 2019 10:24
Extract primary phase thread in VOF with 3 phases Eric FLUENT 2 July 7, 2011 03:22


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