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

Reading specific cell's phase field in multiphaseInterFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2018, 02:30
Default Reading specific cell's phase field in multiphaseInterFoam
  #1
New Member
 
Gabriel Aranha
Join Date: Aug 2018
Posts: 1
Rep Power: 0
aranha92 is on a distinguished road
Hi all,

EDIT 1: Ok, I found out this is a parallelization issue. If I run the solver without parallelization it works perfectly. Now for making it work in parallel.

Things I tried for the parallelization:

1) Using reduce() with 2 approaches:


1.1) This one compiles, but the output stays the same.

Code:
scalar cellPhase1 = phase1[cellID];


 reduce(cellPhase1, sumOp<scalar>());


Info << cellPhase1 << std::endl;

1.2) This one does not compile.
Code:
 reduce(phase1, sumOp<volScalarField>());


Info << phase1[cellID]; << std::endl;
Error:

Code:
required from here
/opt/openfoam6/src/OpenFOAM/lnInclude/gatherScatter.C:63:15:  error: no matching function for call to  ‘Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh>::GeometricField()’
             T value;


2) Using Pstream:


2.1) Does not compile

Code:

List<Field<volScalarField>> gatheredPhase1(Pstream::nProcs());


gatheredPhase1[Pstream::myProcNo()] = phase1;


Pstream::gatherList(gatheredPhase1);


Pstream::scatterList(gatheredPhase1);


phase1 = ListListOps::combine<Field<volScalarField>>
               (
                gatheredPhase1,
                accessOp<volScalarField>()
               );


Info << phase1[cellID]; << std::endl;

Error:
Code:
error:  no match for ‘operator=’ (operand types are ‘Foam::volScalarField {aka  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’  and ‘Foam::Field<Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh> >’)
         );
I've been trying to modify the multiphaseInterFoam solver to read during runtime the fluid phase(the value between 0 and 1) of a specific mesh cell, but with no success. The problem I am dealing with consists of 3 phases, and this is what I tried doing at the moment:


First I store a reference of the volScalarField of each phase by iterating through the phases dictionary in the multiphaseMixture Library.


Code:
volScalarField &phase1 = mixture.getAlpha('phase1')
volScalarField &phase2 = mixture.getAlpha('phase2')
volScalarField &phase3 = mixture.getAlpha('phase3')
After that, a header file is ran every timestep that should give me the phase content of a specific cell, however I am finding it extremely difficult to understand what I am doing wrong.


Code:
phase1[specificCellID]
phase2[specificCellID]
phase3[specificCellID]
The Output comes out the same like this, for all the simulation timesteps:


Code:
phase1 phase2 phase3
7.46E-07 1.54E-05 1.48E-05
I don't know if I should read each phase independently or find some way to read all alphas at the same time. If someone more competent could provide me with a direction I would appreciate a lot.


Thank you!

Last edited by aranha92; December 5, 2018 at 16:35. Reason: Progress towards solving issue
aranha92 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 21:43
Problem with divergence TDK FLUENT 13 December 14, 2018 06:00
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL AndoniBM OpenFOAM Running, Solving & CFD 2 March 25, 2015 18:44
error message cuteapathy CFX 14 March 20, 2012 06:45


All times are GMT -4. The time now is 01:45.