|
[Sponsors] |
Reading specific cell's phase field in multiphaseInterFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 5, 2018, 02:30 |
Reading specific cell's phase field in multiphaseInterFoam
|
#1 |
New Member
Gabriel Aranha
Join Date: Aug 2018
Posts: 1
Rep Power: 0 |
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; 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> >’) ); 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') Code:
phase1[specificCellID] phase2[specificCellID] phase3[specificCellID] Code:
phase1 phase2 phase3 7.46E-07 1.54E-05 1.48E-05 Thank you! Last edited by aranha92; December 5, 2018 at 16:35. Reason: Progress towards solving issue |
|
|
|
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 |