|
[Sponsors] |
January 27, 2021, 12:08 |
multiPhaseEulerFoam extract phase fractions
|
#1 |
Senior Member
Join Date: May 2012
Posts: 551
Rep Power: 16 |
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 } } } |
|
April 3, 2023, 05:44 |
|
#2 |
New Member
yuming_shao
Join Date: Nov 2022
Posts: 3
Rep Power: 3 |
Did you succeed? I have the same problem
|
|
|
|
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 |