CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Tutorials] buoyantHumiditysimplefoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2024, 11:00
Default buoyantHumiditysimplefoam
  #1
zog
New Member
 
Jacques
Join Date: Jul 2019
Posts: 17
Rep Power: 7
zog is on a distinguished road
I am trying to study the effect of a wator vapor/air mixture in respect with heat transfert for buoyant simluations. I have done it in Fluent using UDFs but I want to give it a try with openfoam too. I have not found a lot of documentation, surprisingly, except the work by Tobis Holzmann (https://github.com/shor-ty/humidityRhoThermo) which seems to be what I need.

I could succesfully compile it using openfoam v2212, however it seems not able to be used in its current stage. I am willing to learn and make it work but i could use some guidelines to make it work and understand the details ( not the physics, this part is fine, but the implementation in openfoam).

As I understand it is a modification of the buoyantSimplefoam solver, with custom rhothermo dictionnary. I account for new field variables (psat, humidity, etc) and has several ways to calculate the different parts.

The tricky part is when I try to run the turorials for RAS (I didn't understant the structure for the laminar ones... with the fvOptions apparently containing the mesh and case ?).

For RAS, I could not run the tutorials : apparently the fixedValue BC is not possible for relHum :
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  dev                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      relHumidity;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0.3;

boundaryField
{
    walls 
    {
        type            zeroGradient;
    }

    inletTop 
    {
        type            fixedHumidity;
        mode            relative;
        method          magnus;
        humidity        0.50;
        value           uniform 0.0;
    }

    inletBottom 
    {
        type            fixedValue;
        value           uniform 0.3;
    }
-> I had to put fixedHumidity.

As for the alphat BC :
Code:
*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    walls
    {
        type            compressible::alphatWallFunction;
        value           uniform 0;
    }
, this BC seems again to not exist for the solver (which is weird as it should exist for buoyantSimpleFoam, if my understanding is correct ?? Where can I check what BC aare available for which solver ?
Code:
--> FOAM FATAL IO ERROR: (openfoam-2212)
Unknown patchField type compressible::alphatWallFunction for patch type wall

Valid patchField types :

120
(
MarshakRadiation
MarshakRadiationFixedTemperature
acousticWaveTransmissive
advective
alphatJayatillekeWallFunction
atmAlphatkWallFunction
atmBoundaryLayerInletEpsilon
atmBoundaryLayerInletK
atmBoundaryLayerInletOmega
atmEpsilonWallFunction
atmNutUWallFunction
atmNutWallFunction
atmNutkWallFunction
atmOmegaWallFunction
atmTurbulentHeatFluxTemperature
calculated
codedFixedValue
codedMixed
cyclic
cyclicACMI
cyclicAMI
cyclicSlip
directionMixed
electrostaticDeposition
empty
energyJump
energyJumpAMI
enthalpySorption
epsilonWallFunction
exprFixedValue
exprMixed
extrapolatedCalculated
fan
fanPressure
fixedEnergy
fixedFluxExtrapolatedPressure
fixedFluxPressure
fixedGradient
fixedHumidity
fixedInternalValue
fixedJump
fixedJumpAMI
fixedMean
fixedMeanOutletInlet
fixedPressureCompressibleDensity
fixedProfile
fixedUnburntEnthalpy
fixedValue
freestream
freestreamPressure
gradientEnergy
gradientUnburntEnthalpy
I then tried with alphatJayatillekeWallFunction, but in this case it was missing tansportPorpeties :
Code:
failed lookup of transportProperties (objectRegistry region0)
available objects of type dictionary:
8(MRFProperties radiationProperties turbulenceProperties fvSchemes fvOptions fvSolution thermophysicalProperties data)
So my understanding as of now is that buoyantsimplefoam needs compressible::alphat, but for some reason with the compiled uboyanthumiditysimplefoam i don't have acces to those BC.

I understand i have a lot of, probably, dumb-level question, but i hope to learn from making this case work !
zog is offline   Reply With Quote

Old   September 27, 2024, 19:02
Default
  #2
zog
New Member
 
Jacques
Join Date: Jul 2019
Posts: 17
Rep Power: 7
zog is on a distinguished road
Ok, so I made progress : i added in the Make/Options file the missing (how does it work without it i don't know)
Code:
 23     -lthermoTools \
. Now it recognises the compressible::alphatwallfunction and starts running.

It crashes very soon though :
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2212                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _66908158ae-20221220 OPENFOAM=2212 version=v2212
Arch   : "LSB;label=32;scalar=64"
Exec   : buoyantHumiditySimpleFoam
Date   : Sep 27 2024
Time   : 23:57:18
Host   : dellvisu
PID    : 2927142
I/O    : collated [unthreaded] (maxThreadFileBufferSize = 0).
         Writing may be slow for large file sizes.
Case   : /clust/opti/Projets/PROJET_JUNE/TestsSolvers/BenchOpenFoam/OF_HT/humidityRhoThermo/tutorials/RAS/fixedHumidityBC
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStamp (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0


SIMPLE: no convergence criteria found. Calculations will run for 40 steps.

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            heHumidityRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Initilize humidity by using the specificHumidity field

Saturation pressure calculation based on magnus

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
RAS
{
    RASModel        kEpsilon;
    turbulence      on;
    printCoeffs     on;
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              0;
    sigmak          1;
    sigmaEps        1.3;
}


Reading g

Reading hRef
Calculating field g.h

Reading field p_rgh

No MRF models present

Radiation model not active: radiationProperties not found
Selecting radiationModel none
No finite volume options present

Starting time loop

Time = 1e-05

DILUPBiCGStab:  Solving for Ux, Initial residual = 1, Final residual = 0.0757645, No Iterations 4
DILUPBiCGStab:  Solving for Uy, Initial residual = 1, Final residual = 0.0975279, No Iterations 7
DILUPBiCGStab:  Solving for h, Initial residual = 1, Final residual = 0.0608328, No Iterations 61
DILUPBiCGStab:  Solving for specificHumidity, Initial residual = 0.999998, Final residual = 9.73857e-15, No Iterations 1
   Total water = 7.72215e-09 kg
    Correcting 8000 cells which were higher than max
DICPCG:  Solving for p_rgh, Initial residual = 0.99892, Final residual = 0.0088738, No Iterations 114
time step continuity errors : sum local = 0.0179089, global = -5.99806e-05, cumulative = -5.99806e-05
rho min/max : 1.6393e-07 1.04011e-05
DILUPBiCGStab:  Solving for epsilon, Initial residual = 0.121504, Final residual = 0.0111817, No Iterations 4
bounding epsilon, min: -1.23996e-10 max: 0.960829 average: 0.000286127
DILUPBiCGStab:  Solving for k, Initial residual = 1, Final residual = 0.0850395, No Iterations 8
ExecutionTime = 0.08 s  ClockTime = 0 s

Time = 2e-05

DILUPBiCGStab:  Solving for Ux, Initial residual = 0.940569, Final residual = 0.0231604, No Iterations 6
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.917402, Final residual = 0.0850456, No Iterations 6
DILUPBiCGStab:  Solving for h, Initial residual = 0.851902, Final residual = 34.2936, No Iterations 1000
DILUPBiCGStab:  Solving for specificHumidity, Initial residual = 1, Final residual = 3.30772e+121, No Iterations 1000
bounding specificHumidity, min: -1.97106e+123 max: 1.32278e+123 average: -8.94243e+119
   Total water = 1.3772e-06 kg
    Correcting 8000 cells which were higher than max
DICPCG:  Solving for p_rgh, Initial residual = 0.999991, Final residual = 0.00951238, No Iterations 137
time step continuity errors : sum local = 1.38311e-09, global = 4.67507e-13, cumulative = -5.99806e-05
rho min/max : -1.26267e-07 2.30892e-06
#0  Foam::error::printStack(Foam::Ostream&) in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#1  Foam::sigFpe::sigHandler(int) in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#2  ? in /lib64/libpthread.so.0
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#4  void Foam::divide<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in ~/OpenFOAM/jacques-v2212/platforms/linux64GccDPInt32Opt/bin/buoyantHumiditySimpleFoam
#5  Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator/<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#6  Foam::compressibleTurbulenceModel::phi() const in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libcompressibleTurbulenceModels.so
#7  Foam::RASModels::kEpsilon<Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > >::correct() in /clust/softs/OpenFOAM/OpenFOAM-v2212/platforms/linux64GccDPInt32Opt/lib/libcompressibleTurbulenceModels.so
#8  ? in ~/OpenFOAM/jacques-v2212/platforms/linux64GccDPInt32Opt/bin/buoyantHumiditySimpleFoam
#9  __libc_start_main in /lib64/libc.so.6
#10  ? in ~/OpenFOAM/jacques-v2212/platforms/linux64GccDPInt32Opt/bin/buoyantHumiditySimpleFoam
Exception en point flottant (core dumped)
I suspect my issue is with the initial value of specific humidity, so I switched to the brother tutorial that is without moisture : named "withoutHumidity".

Here i go :
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2212                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _66908158ae-20221220 OPENFOAM=2212 version=v2212
Arch   : "LSB;label=32;scalar=64"
Exec   : buoyantHumiditySimpleFoam
Date   : Sep 28 2024
Time   : 00:05:41
Host   : dellvisu
PID    : 2927538
I/O    : collated [unthreaded] (maxThreadFileBufferSize = 0).
         Writing may be slow for large file sizes.
Case   : /clust/opti/Projets/PROJET_JUNE/TestsSolvers/BenchOpenFoam/OF_HT/humidityRhoThermo/tutorials/RAS/withoutHumidity
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStamp (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0


SIMPLE: no convergence criteria found. Calculations will run for 40 steps.

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            heHumidityRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

--> FOAM Warning : 
    From bool Foam::IOobject::typeHeaderOk(bool, bool, bool) [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /clust/softs/OpenFOAM/OpenFOAM-v2212/src/OpenFOAM/lnInclude/IOobjectTemplates.C at line 72
    Unexpected class name "dictionary" expected "volScalarField" when reading "/clust/opti/Projets/PROJET_JUNE/TestsSolvers/BenchOpenFoam/OF_HT/humidityRhoThermo/tutorials/RAS/withoutHumidity/0/relHum"
--> FOAM Warning : 
    From bool Foam::IOobject::typeHeaderOk(bool, bool, bool) [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /clust/softs/OpenFOAM/OpenFOAM-v2212/src/OpenFOAM/lnInclude/IOobjectTemplates.C at line 72
    Unexpected class name "dictionary" expected "volScalarField" when reading "/clust/opti/Projets/PROJET_JUNE/TestsSolvers/BenchOpenFoam/OF_HT/humidityRhoThermo/tutorials/RAS/withoutHumidity/0/relHum"


--> FOAM FATAL ERROR: (openfoam-2212)
Neither the specificHumidity or the relHum field was provided in the time-folder

    From virtual void Foam::humidityRhoThermo::readOrInitSpecificHumidity()
    in file humidityRhoThermo/humidityRhoThermo.C at line 698.

FOAM exiting
I don't think the tutorials have been ran in a ... long time, despite the git push for v2212 tutorials it seems.

I'll continue to dig in and try to make it work, and report here, hopefully it's just a couple more small fixes !

Last edited by zog; September 28, 2024 at 04:03.
zog is offline   Reply With Quote

Old   October 23, 2024, 02:50
Default
  #3
New Member
 
Join Date: Jan 2024
Posts: 25
Rep Power: 2
Zomzzz is on a distinguished road
Hii,,

have you found any solution to that, i am running into same exact issue
Zomzzz 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



All times are GMT -4. The time now is 00:35.