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

chtMultiRegionTwoPhaseEulerFoam thermo package not available

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2022, 11:34
Default chtMultiRegionTwoPhaseEulerFoam thermo package not available
  #1
New Member
 
roham seif
Join Date: Jul 2020
Posts: 6
Rep Power: 5
Roham..Seif is on a distinguished road
Hi all,

I started from the tutorial of solidQuenching2D, changed the BCs to close the system, so maxY is not open anymore.
I need to have heat loss at the two walls of the system. I used externalWallHeatFluxTemperature as BC and gave attention to set solidTehrmo for kappa method in <solid region> and fluidThermo for kappaMethod in <fluids region>. Still get the following error. Thank you very much in advance.
OF version 2112
Geometry is the same as the tutorial file.
Solid 0/T:
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
volScalarField;
    
object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      0 0 0 1 0 0 0 ];

internalField   uniform 553.15;

boundaryField
{
    
#includeEtc "caseDicts/setConstraintTypes"

  /*  maxY
    {
        type            zeroGradient;
    }
*/
    
solid_to_water
    
{
        
type            compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
        
value           uniform 553.15;
        
Tnbr            T.liquid;
        
kappaMethod     solidThermo;
        
region          solid;
        
// Name of the other phase in the flid region mixing with 'liquid' phase
        
otherPhase      gas;
        
qrNbr           none;
        
qr              none;
    }

liquid 0/T
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
volScalarField;
    
object      T.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      0 0 0 1 0 0 0 ];

internalField   uniform 408.15;

boundaryField
{
    
#includeEtc "caseDicts/setConstraintTypes"

/*    maxY
    {
        type            inletOutlet;
        value           uniform 373;
        inletValue      uniform 373;
    }
*/
    
maxY
    
{
      
type            externalWallHeatFluxTemperature;
      
mode            coefficient;        //'power', 'flux' or 'coefficient'
      
Ta              constant 313.15;     //Required     for mode 'coefficient'
      
h               constant 10.0;      //Required     for mode 'coefficient'
      
thicknessLayers (0.01 0.02);        //Layer thicknesses [m]
      
kappaLayers     (2.25 1.25);        //Layer thermal conductivities [W/m/K]
      
kappaMethod     fluidThermo;
      
value           $internalField;
    }

    
maxX
    
{
      
type            zeroGradient;
      
value           $internalField;
    }

    
minY
    
{
      
type            externalWallHeatFluxTemperature;
      
mode            coefficient;        //'power', 'flux' or 'coefficient'
      
Ta              constant 313.15;     //Required     for mode 'coefficient'
      
h               constant 10.0;      //Required     for mode 'coefficient'
      
thicknessLayers (0.01 0.02);        //Layer thicknesses [m]
      
kappaLayers     (2.25 1.25);        //Layer thermal conductivities [W/m/K]
      
kappaMethod     fluidThermo;
      
value           $internalField;
    }

    
water_to_solid
    
{
        
type            compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
        
value           uniform 553.15;
        
Tnbr            T;
        
kappaMethod     phaseSystem;
        
region          fluid;
        
// Name of the other phase in the fluid region mixing with this phase
        
otherPhase      gas;
        
qrNbr           none;
        
qr              none;
    }

gas 0/T
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
volScalarField;
    
object      T.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      0 0 0 1 0 0 0 ];

internalField   uniform 408.15;

boundaryField
{
    
#includeEtc "caseDicts/setConstraintTypes"

/*    maxY
    {
        type            inletOutlet;
        value           uniform 373;
        inletValue      uniform 373;
    }
*/
    
maxY
    
{
      
type            externalWallHeatFluxTemperature;
      
mode            coefficient;        //'power', 'flux' or 'coefficient'
      
Ta              constant 313.15;     //Required     for mode 'coefficient'
      
h               constant 10.0;      //Required     for mode 'coefficient'
      
thicknessLayers (0.01 0.02);        //Layer thicknesses [m]
      
kappaLayers     (2.25 1.25);        //Layer thermal conductivities [W/m/K]
      
kappaMethod     fluidThermo;
      
value           $internalField;
    }

    
maxX
    
{
      
type            zeroGradient;
      
value           $internalField;
    }
    
minY
    
{
      
type            externalWallHeatFluxTemperature;
      
mode            coefficient;        //'power', 'flux' or 'coefficient'
      
Ta              constant 313.15;     //Required     for mode 'coefficient'
      
h               constant 10.0;      //Required     for mode 'coefficient'
      
thicknessLayers (0.01 0.02);        //Layer thicknesses [m]
      
kappaLayers     (2.25 1.25);        //Layer thermal conductivities [W/m/K]
      
kappaMethod     fluidThermo;
      
value           $internalField;
    }

    
water_to_solid
    
{
        
type            copiedFixedValue;
        
sourceFieldName T.liquid;
        
value           uniform 553.15;
    }

solid thermoPhysicalProperties
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
dictionary;
    
object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    
type            heSolidThermo;
    
mixture         pureMixture;
    
transport       constIso;
    
thermo          hConst;
    
equationOfState rhoConst;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

mixture
{
    
specie
    
{
        
molWeight   50;
    }
    
transport
    
{
        
kappa   60;
    }
    
thermodynamics
    
{
        
Hf      0;
        
Cp      450;
    }
    
equationOfState
    
{
        
rho     8000;
    }

gas thermoPhyisicalProperties
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
dictionary;
    
object      thermophysicalProperties.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    
type            heRhoThermo;
    
mixture         pureMixture;
    
transport       const;
    
thermo          hConst;
    
equationOfState perfectGas;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

dpdt no;

mixture
{
    
specie
    
{
        
molWeight       18.0153;
    }
    
equationOfState
    
{
        
rho        1;
    }
    
thermodynamics
    
{
        
Hf          0;
        
Cp          2078;//12078.4;//.4;//;
        
Tref        373.55;
        
Href        2675500;
    }
    
transport
    
{
        
mu          1.2256e-5;
        
Pr          2.289;
    }

liquid thermoPhysicalProperties
PHP Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    
version     2.0;
    
format      ascii;
    class       
dictionary;
    
object      thermophysicalProperties.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    
type            heRhoThermo;
    
mixture         pureMixture;
    
transport       const;
    
thermo          hConst;
    
equationOfState rhoConst;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

dpdt no;

mixture
{
    
specie
    
{
        
molWeight       18.0153;
    }
    
equationOfState
    
{
        
rho         1000;
    }
    
thermodynamics
    
{
        
Hf          0;
        
Cp          4195;
        
Tref        373.55;
        
Href        417500;
    }
    
transport
    
{
        
mu          959e-6;
        
Pr          6.62;
    }

error:
PHP Code:
Build  _80318542-20220301 OPENFOAM=2112 patch=220310 version=2112
Arch   
"LSB;label=32;scalar=64"
Exec   chtMultiRegionTwoPhaseEulerFoam
Date   
Apr 29 2022
Time   
17:17:32
Host   
DESKTOP-KQHAQ38
PID    
12064
I
/O    uncollated
Case   : /home/rohamapr/OpenFOAM_2112/solidQuenching2D.7
nProcs 
1
trapFpe
Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5maxFileModificationPolls 20)
allowSystemOperations Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Overriding DebugSwitches according to controlDict
    compressible
::alphatWallBoilingWallFunction 0;

    
compressible::turbulentTemperatureTwoPhaseRadCoupledMixed 0;

Create fluid mesh for region water for time 0

Create solid mesh 
for region solid for time 0

*** Reading fluid mesh thermophysical properties for region water


PIMPLE
no residual control data foundCalculations will employ 2 corrector loops

    Adding to phaseSystemFluid

Selecting twoPhaseSystem thermalPhaseChangeTwoPhaseSystem
Selecting phaseModel 
for gaspurePhaseModel
Selecting diameterModel 
for phase gasisothermal
Selecting thermodynamics package 
{
    
type            heRhoThermo;
    
mixture         pureMixture;
    
transport       const;
    
thermo          hConst;
    
equationOfState perfectGas;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

Calculating face flux field phi.gas
Selecting turbulence model type RAS
Selecting RAS turbulence model mixtureKEpsilon
Selecting partitioningModel
Lavieville
RAS
{
    
RASModel        mixtureKEpsilon;
    
turbulence      on;
    
printCoeffs     on;
    
Cmu             0.09;
    
C1              1.44;
    
C2              1.92;
    
C3              1.92;
    
Cp              0.25;
    
sigmak          1;
    
sigmaEps        1.3;
}

Selecting phaseModel for liquidpurePhaseModel
Selecting diameterModel 
for phase liquidconstant
Selecting thermodynamics package 
{
    
type            heRhoThermo;
    
mixture         pureMixture;
    
transport       const;
    
thermo          hConst;
    
equationOfState rhoConst;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

Calculating face flux field phi.liquid
Selecting turbulence model type RAS
Selecting RAS turbulence model mixtureKEpsilon
Selecting partitioningModel
Lavieville
Selecting partitioningModel
Lavieville
Selecting nucleationSiteModel
LemmertChawla
Selecting departureDiameterModel
TolubinskiKostanchuk
Selecting departureFrequencyModel
Cole
Selecting LeidenfrostModel
Spiegler
Selecting CHFModel
Zuber
Selecting CHFSubCoolModel
HuaXu
Selecting MHFModel
Jeschar
Selecting TDNBModel
Schroeder
Selecting filmBoilingModel
Bromley
RAS
{
    
RASModel        mixtureKEpsilon;
    
turbulence      on;
    
printCoeffs     on;
    
Cmu             0.09;
    
C1              1.44;
    
C2              1.92;
    
C3              1.92;
    
Cp              0.25;
    
sigmak          1;
    
sigmaEps        1.3;
}

No MRF models present

Selecting 
default blending methodlinear
Selecting drag blending method
linear
Selecting heatTransfer blending method
linear
Selecting massTransfer blending method
linear
Selecting surfaceTensionModel 
for (gas and liquid): constant
Selecting aspectRatioModel 
for (gas in liquid): constant
Selecting aspectRatioModel 
for (liquid in gas): constant
Selecting dragModel 
for (gas in liquid): IshiiZuber
Selecting swarmCorrection 
for (gas in liquid): none
Selecting dragModel 
for (liquid in gas): IshiiZuber
Selecting swarmCorrection 
for (liquid in gas): none
Selecting virtualMassModel 
for (gas in liquid): constantCoefficient
Selecting virtualMassModel 
for (liquid in gas): constantCoefficient
Selecting liftModel 
for (gas in liquid): Tomiyama
Selecting wallLubricationModel 
for (gas in liquid): Antal
Selecting turbulentDispersionModel 
for (gas in liquid): Burns
Selecting heatTransferModel 
for (gas in liquid): spherical
Selecting heatTransferModel 
for (liquid in gas): RanzMarshall
Selecting heatTransferModel 
for (gas in liquid): RanzMarshall
Selecting heatTransferModel 
for (liquid in gas): spherical
Selecting saturationModel
function1
    Adding hRefFluid

    Adding ghRef

    Adding p_rghFluid

    Correcting p_rghFluid

    Correcting initialMassFluid

    Setting reference

*** Reading solid mesh thermophysical properties for region solid

    Adding to thermos

Selecting thermodynamics package 
{
    
type            heSolidThermo;
    
mixture         pureMixture;
    
transport       constIso;
    
thermo          hConst;
    
equationOfState rhoConst;
    
specie          specie;
    
energy          sensibleEnthalpy;
}

    
Adding to radiations

Selecting radiationModel none
    Adding fvOptions

Courant Number max
0
Region
solid Diffusion Number mean4.4725177305e-05 max0.000266666666667
Selecting heat transfer coefficient model fixedReferenceTemperature
surfaceFieldValue htcSurfaceFieldValue
:
    
operation     areaAverage


deltaT 
1e-06
Courant Number max
0
Region
solid Diffusion Number mean4.4725177305e-05 max0.000266666666667
deltaT 
1.19999040008e-06
Time 
1.19999e-06


Solving 
for fluid region water
Creating finite volume options from 
"constant/fvOptions"

Selecting finite volume options type limitTemperature
    Source
limitTLiq
    
selecting all cells
    
selected 23300 cell(swith volume 1.91882352941e-05
Selecting finite volume options type limitTemperature
    Source
limitTGas
    
selecting all cells
    
selected 23300 cell(swith volume 1.91882352941e-05
MULES
Solving for alpha.gas
MULES
Solving for alpha.gas
MULES
Solving for alpha.gas
alpha
.gas volume fraction 0.656652360515  Min(alpha1) = 0  Max(alpha1) = 1
Constructing face momentum equations
Tf
.gasAndLiquidmin 408.15mean 408.15max 408.15
wDmdt
.gasAndLiquidmin 0mean 0.0877555175149max 32.9032756478integral 1.68387351845e-06


--> FOAM FATAL ERROR: (openfoam-2112 patch=220310)
Using kappaMethod fluidThermobut thermo package not available


    From virtual Foam
::tmp<Foam::Field<double> > Foam::temperatureCoupledBase::kappa(const scalarField&) const
    
in file turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C at line 266.

FOAM exiting 
Roham..Seif is offline   Reply With Quote

Old   May 2, 2022, 11:59
Default
  #2
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
Have you try narrowing down the error to an specific BC/patch?
Try using another BC instead of externalWall[...] to see if the error is within that BC.

Is that BC implemented in the chtMulti-twoPhase?
JulioPieri is offline   Reply With Quote

Old   May 2, 2022, 12:19
Default
  #3
New Member
 
roham seif
Join Date: Jul 2020
Posts: 6
Rep Power: 5
Roham..Seif is on a distinguished road
Thank you for the reponse.

-I set the BC to only one of the walls, still the same error.
-I tried zeroGradient instead of externalWallHeatFluxTemperature and it worked fine.
-using the "banana" trick:

--> FOAM FATAL IO ERROR: (openfoam-2112 patch=220310)
Unknown patchField type banana for patch type wall

Valid patchField types :
.
.
.
externalWallHeatFluxTemperature
.
.
Roham..Seif is offline   Reply With Quote

Old   May 2, 2022, 12:57
Default
  #4
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
Could you share your case? I'll try from my side
JulioPieri is offline   Reply With Quote

Old   May 2, 2022, 15:12
Default
  #5
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
Actually I was able to reproduce the error from the tutorial case.

I did some research and the relevant part of the code is:

Code:
switch (method_)
     {
         case mtFluidThermo:
         {
             typedef compressible::turbulenceModel turbulenceModel;
  
             {
                 const auto* ptr =
                     mesh.cfindObject<turbulenceModel>
                     (
                         turbulenceModel::propertiesName
                     );
  
                 if (ptr)
                 {
                     return ptr->kappaEff(patchi);
                 }
             }
  
             {
                 const auto* ptr =
                     mesh.cfindObject<fluidThermo>(basicThermo::dictName);
  
                 if (ptr)
                 {
                     return ptr->kappa(patchi);
                 }
             }
  
             {
                 const auto* ptr =
                     mesh.cfindObject<basicThermo>(basicThermo::dictName);
  
                 if (ptr)
                 {
                     return ptr->kappa(patchi);
                 }
             }
  
             {
                 const auto* ptr =
                     mesh.cfindObject<basicThermo>("phaseProperties");
  
                 if (ptr)
                 {
                     return ptr->kappa(patchi);
                 }
             }
  
             FatalErrorInFunction
                 << "Using kappaMethod " << KMethodTypeNames_[method_]
                 << ", but thermo package not available\n"
                 << exit(FatalError);
  
             break;
         }
...
There is a discussion here (it's no the exact same problem but it can point to the solution): https://develop.openfoam.com/Develop...s/-/issues/946

In one of the comments, a user suggest to calculate kappa and create a kapp field to use with "lookup" kappaMethod, or to use fixedGradient.
JulioPieri is offline   Reply With Quote

Old   May 8, 2022, 07:06
Default
  #6
New Member
 
roham seif
Join Date: Jul 2020
Posts: 6
Rep Power: 5
Roham..Seif is on a distinguished road
Many thanks Julio.

I prefer not to keep the gradient constant. The other option sounds promissing but I do not know how can I define kappa for it. Any help is appreciated.
Roham..Seif is offline   Reply With Quote

Old   May 9, 2022, 09:28
Default
  #7
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
You might have to modify the solver to create an IOobject. codedFunction might work here. It's a very simple operation, though. You can also use swak4Foam for that.

Check the available funcionObjects as it could have one for kappa (I'm not sure).

To calculate Kappa, you can initially assume a constant for the material. Then get the temperature field and recalculate kappa in a spreadsheet for each cell. Then update the results in the kappa field file (you have to think some clever ordering here) and run the case for a while. You can iterate this a few times to "converge" the kappa method.

I've never done this with kappa, but did similar procedure to calculate the "h" and "Ta" of the same BC and it gave me good results.
JulioPieri is offline   Reply With Quote

Old   April 9, 2024, 22:27
Angry Governing equations
  #8
New Member
 
Oscar Zagal
Join Date: Jan 2024
Posts: 15
Rep Power: 2
oscar_zagal is on a distinguished road
Hi dear all

Do you know where can I get the governing equations of the solver chtMultiRegionTwoPhaseEulerFoam?

Thanks in advance.
oscar_zagal is offline   Reply With Quote

Old   April 10, 2024, 08:41
Default
  #9
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
You should be able to find it for twoPhaseEuler (multiphaseEuler, etc) and for chtMultiRegion separately.

Try looking for similar solvers from other codes (commercial ones, for instance) as well, as the equation should most likely be the same.
JulioPieri is offline   Reply With Quote

Old   April 10, 2024, 10:36
Default
  #10
New Member
 
Oscar Zagal
Join Date: Jan 2024
Posts: 15
Rep Power: 2
oscar_zagal is on a distinguished road
Quote:
Originally Posted by JulioPieri View Post
You should be able to find it for twoPhaseEuler (multiphaseEuler, etc) and for chtMultiRegion separately.

Try looking for similar solvers from other codes (commercial ones, for instance) as well, as the equation should most likely be the same.
Thanks for your advice, the source code is very complicated, is not like the basic solvers.
oscar_zagal 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
[foam-extend.org] foam-extend-4.1 cannot compile on Centos8 Ya_Squall2010 OpenFOAM Installation 2 July 22, 2020 02:03
[foam-extend.org] paraview not runing? (foam extended 3.2 and ubuntu 15.04) Milan2013 OpenFOAM Installation 23 April 20, 2017 05:49
[OpenFOAM.org] Building OpenFOAM 3.0.1 on Ubuntu 16.04 - failed erico OpenFOAM Installation 30 February 2, 2017 09:24
OF 1.6 ext on Ubuntu 12.10 (64 bit) compilation errors dreamilam OpenFOAM Installation 7 April 21, 2013 05:43
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20:30


All times are GMT -4. The time now is 10:28.