|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Jacques
Join Date: Jul 2019
Posts: 23
Rep Power: 8 ![]() |
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;
}
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;
}
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 Code:
failed lookup of transportProperties (objectRegistry region0) available objects of type dictionary: 8(MRFProperties radiationProperties turbulenceProperties fvSchemes fvOptions fvSolution thermophysicalProperties data) I understand i have a lot of, probably, dumb-level question, but i hope to learn from making this case work ! |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Jacques
Join Date: Jul 2019
Posts: 23
Rep Power: 8 ![]() |
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 \ 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)
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'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. |
|
|
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jan 2024
Posts: 44
Rep Power: 3 ![]() |
Hii,,
have you found any solution to that, i am running into same exact issue |
|
|
|
|
|
|
|
|
#4 |
|
New Member
Jacques
Join Date: Jul 2019
Posts: 23
Rep Power: 8 ![]() |
Yes, but i used the other github : https://github.com/TBE-ThomasTian/HVAC-for-OpenFOAM
I had to change a couple things, can't remember what were the few issues, but by comparing to original files it was quite easy to debug. I am unsure if there is an issue with the density at this point, when comparing to fluent i see some concerning differences. When i get some time to further dig into it i'll update the post. Feel free to do the same ! Alos, if you do have some insight on a test case with actual analytical data, or good experimental data, as a benchmark, it would be very nice to implement as a tutorial and also to ensure everything is well and good. |
|
|
|
|
|
|
|
|
#5 |
|
New Member
Jacques
Join Date: Jul 2019
Posts: 23
Rep Power: 8 ![]() |
the density was indeed wrong : it was simply set a rho_old - rho_watercontent. It need to be explicitly set to rho_DryAir _ rho_waterContent. A dry air density has to be added, same way watercontent density was calculated.
Additionnally, the diffusion coefficient in the transport equation is set to the viscosity. It should be set to the molecular diffusion. I am currently trying to add a way to read it from the dictionnaries but failed so far (if anyone wants to guide me would be welcome ! since the dictionnaries are mixed up due to the new heHumidityRhoThermo files. I'll update when i get it ! |
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
Tian
Join Date: Mar 2009
Location: Berlin, germany
Posts: 123
Rep Power: 18 ![]() |
Hi Zog,
Could you share your fix. I can add it or apply it in my version. I updated my Git humidity code for 2506 based on your suggestion. Thanks Thomas Option ne
__________________
BIM HVACTool, The Green Building Simulation Tool for OpenFOAM, Energy Plus and Radiance. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|