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

IcoReactingMultiphaseinterFoam - Adaptive meshing issue - CorrectPhi was not declare

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

Like Tree1Likes
  • 1 Post By clapointe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2021, 09:53
Post IcoReactingMultiphaseinterFoam-Adaptive meshing issue/CorrectPhi was not declared
  #1
New Member
 
Harris Daniel S
Join Date: Oct 2017
Posts: 8
Rep Power: 8
Harris_Daniel is on a distinguished road
Dear OpenFOAM users,


I am trying to create an adaptive meshing solver with IcoReactingMultiphaseInterFoam as a basic solver. I included the dynamics mesh portion of the code from multiphaseInterFoam solver and added all the relevant libraries in the make/options file.

But the solver does not recognize "CorrectPhi" function called from "correctPhi.H" and "initCorrectPhi.H" file during compilation.

Correct phi is placed in the following location /home/OpenFOAM/OpenFOAM-v1806/src/finiteVolume/lnInclude

Added libraries are called using the following line in the Options file: -I$(LIB_SRC)/finiteVolume/lnInclude \ and -lfiniteVolume \

But I get CorrectPhi not declared error when I try to compile.

Quote:
/OpenFOAM/OpenFOAM-v1806/applications/solvers/multiphase/interFoam/correctPhi.H: In function ‘int main(int, char**)’:
/home/OpenFOAM/OpenFOAM-v1806/applications/solvers/multiphase/interFoam/correctPhi.H:9:1: error: ‘CorrectPhi’ was not declared in this scope
);
^
In file included from IRMPIDyFoam.C:79:0:
/home/OpenFOAM/OpenFOAM-v1806/applications/solvers/multiphase/interFoam/initCorrectPhi.H:31:5: error: ‘CorrectPhi’ was not declared in this scope
);
^
In file included from IRMPIDyFoam.C:134:0:
correctPhi.H:9:1: error: ‘CorrectPhi’ was not declared in this scope
);
^
IRMPIDyFoam.C:139:25: error: ‘mixture’ was not declared in this scope
mixture.correct();
^
I am attaching the solver file for reference here. Please suggest a fix for this problem.

Couple of question:

If we copy the dynamic mesh portion of the code from a incompressible solver into a compressible solver, will it cause problems associated with mass flux, phi?

MultiphaseInterFoam uses mixture model and icoReactingMutiphaseInterFoam seems to use it only partially(Need clarity here), will that lead to problems when mixture object is called?

Thanks and Regards,
Harris.

Contents of option file:

Quote:
EXE_INC = \
-I. \
-I$(FOAM_SOLVERS)/VoF \
-I$(FOAM_SOLVERS)/multiphase/interFoam \
-ImultiphaseMixture/lnInclude \
-I./phasesSystem/lnInclude \
-I./CompressibleMultiPhaseTurbulenceModels/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude\
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude

EXE_LIBS = \
-lmultiphaseInterFoam \
-linterfaceProperties \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lcompressibleTurbulenceModels \
-lcompressibleTransportModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-lmeshTools \
-lfvOptions \
-lsampling \
-lradiationModels \
-lfluidThermophysicalModels \
-lIncompressibleMultiphaseSystems \
-lCompressibleMultiPhaseTurbulenceModels \
-lmassTransferModels \
-lsolidThermo \
-lsolidSpecie \
-ltwoPhaseProperties \
-llaserDTRM
Attached Files
File Type: c IRMPIDyFoam.C (5.1 KB, 4 views)

Last edited by Harris_Daniel; June 3, 2021 at 02:17.
Harris_Daniel is offline   Reply With Quote

Old   June 2, 2021, 19:21
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
For the first question, you'll note that CorrectPhi.H is included in the interMixingFoam.C file (and is missing in yours) -- this is why the compiler is complaining. As for the flux correction for compressible vs incompressible, it makes a difference. Just take a look at how CorrectPhi is used in e.g. rhoPimpleFoam vs pimpleFoam.

A quick look at code, though, and you'll see that it uses an incompressible formulation of the pressure corrector like interFoam/interMixingFoam does. So the flux correction would be the same. If you look at the dev branch, you'll even notice that dynamic mesh functionality is now included with icoReactingMultiphaseInterFoam.

Caelan
Harris_Daniel likes this.
__________________
Public git repository : https://github.com/clapointe2011/public
clapointe is offline   Reply With Quote

Old   June 5, 2021, 07:40
Post Dynamic Mesh IcoReactingMultiPhaseInterFoam
  #3
New Member
 
Harris Daniel S
Join Date: Oct 2017
Posts: 8
Rep Power: 8
Harris_Daniel is on a distinguished road
Dear OpenFOAM users,
I am using OpenFOAM-v2012. I am interested in IcoReactingMultiphaseinterFoam. I came to know that dynamic meshing is defined in the solver. But could not find code related to adaptive meshing or mesh motion in the solver.
Do I need to include dynamic mesh related code into the solver? I tried using the solver for dynamic meshing unsuccessfully.

Please find the dynamicMeshDict attached here. Please suggest a fix and advice appropriately. Thanks
-Harris.


Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh   dynamicRefineFvMesh;

dynamicRefineFvMeshCoeffs
{
    // How often to refine
    refineInterval  1;
    // Field to base refinement on
    field           alpha.liquid;
    // Refine field inbetween lower..upper
    lowerRefineLevel 0.00001;
    upperRefineLevel 0.99999;
    unrefinedLevel  10;
    // Have slower than 2:1 refinement
    nBufferLayers   1;
    // Refine cells only up to maxRefinement levels
    maxRefinement   2;
    // Stop refinement if maxCells reached
    maxCells        200000;
    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity. Use 'none'
    // on surfaceScalarFields that do not need to be reinterpolated.
    correctFluxes
    (
        (phi none)
        (nHatf none)
        (rhoPhi none)
        (ghf none)
        (alphaPhi none)
        (alphaPhiUn none)
        (alphaPhi0.liquid none)
    );
    // Write the refinement level as a volScalarField
    dumpLevel       true;
}


// ************************************************************************* //
Harris_Daniel is offline   Reply With Quote

Old   June 5, 2021, 13:22
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
The dynamic mesh functionality is included in the solver in the dev branch. I don't know offhand if it is included in v2012. It sounds like it is not, so you could use the dev branch solver as a reference and update the v2012 one accordingly.

Caelan
__________________
Public git repository : https://github.com/clapointe2011/public
clapointe is offline   Reply With Quote

Reply

Tags
adaptive meshing, correctphi, dynamicmesh error, multiphase mixture model, phi openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] OpenFOAM 2.3.x on Mac OS X 10.10.1 Installation Errors Petru OpenFOAM Installation 15 December 29, 2015 13:51
[Gmsh] Vertex numbering is dense KateEisenhower OpenFOAM Meshing & Mesh Conversion 7 August 3, 2015 11:49
Y+ Adaptive Meshing sd49 FLUENT 0 February 26, 2015 15:15
Meshing related issue in Flow EFD appu FloEFD, FloWorks & FloTHERM 1 May 22, 2011 09:27
Simple Frustrating Meshing Issue in Gambit (w/pics) Dylan ANSYS Meshing & Geometry 6 March 23, 2009 17:14


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