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

Issue with buoyantSimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2024, 10:40
Default Issue with buoyantSimpleFoam
  #1
New Member
 
Nicolas Poupelin
Join Date: Mar 2024
Posts: 4
Rep Power: 2
Nicopoup is on a distinguished road
Hello everyone,

I'm a beginner with open foam, but I would have liked to be able to calculate pmv and ppd, but before I could get them, I made an error in my calculation:

buoyantSimpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : _7bdb509494-20201222 OPENFOAM=2012
Arch : "LSB;label=32;scalar=64"
Exec : buoyantSimpleFoam
Date : Mar 21 2024
Time : 15:18:51
Host : DESKTOP-LBS0ECK
PID : 53069
I/O : uncollated
Case : /mnt/c/Users/Nicopoup/tutorial/confort
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (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 0.5 steps.

Reading thermophysical properties

Selecting thermodynamics package
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState
{
type perfectGas;
}
specie
{
nMoles 1;
molWeight 28.97;
}
energy
{
type heTotalEnergy;
specificHeat Cp [ 0 2 -2 -1 0 0 0 ] 1000;
}
}



--> FOAM FATAL IO ERROR: (openfoam-2012)
Attempt to return dictionary entry as a primitive

file: /mnt/c/Users/Nicopoup/tutorial/confort/constant/thermophysicalProperties.thermoType.energy at line 27 to 28.

From virtual Foam::ITstream& Foam::dictionaryEntry::stream() const
in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 82.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::IOerror::exitOrAbort(int, bool) at ??:?
#2 Foam::dictionaryEntry::stream() const at ??:?
#3 Foam::word Foam::dictionary::get<Foam::word>(Foam::word const&, Foam::keyType:ption) const at ??:?
#4 Foam::HashTable<Foam::autoPtr<Foam::rhoThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash>::iterator Foam::basicThermo::lookupThermo<Foam::rhoThermo, Foam::HashTable<Foam::autoPtr<Foam::rhoThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash> >(Foam::dictionary const&, Foam::HashTable<Foam::autoPtr<Foam::rhoThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash>*) at ??:?
#5 Foam::autoPtr<Foam::rhoThermo> Foam::basicThermo::New<Foam::rhoThermo>(Foam::fvMe sh const&, Foam::word const&) at ??:?
#6 Foam::rhoThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:?
#7 ? at ??:?
#8 ? in /lib/x86_64-linux-gnu/libc.so.6
#9 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#10 ? at ??:?
Aborted

I would like to know how to correct the code so that it works.

Thank you in advance
Nicopoup is offline   Reply With Quote

Old   March 21, 2024, 10:42
Default More informations
  #2
New Member
 
Nicolas Poupelin
Join Date: Mar 2024
Posts: 4
Rep Power: 2
Nicopoup is on a distinguished road
For informations, here's the code I use :


#!/bin/bash

# Définition des chemins vers les exécutables OpenFOAM
# source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc
echo "source /opt/OpenFOAM/OpenFOAM-v2012/etc/bashrc" >> ~/.bashrc
source $HOME/.bashrc

# Se déplacer dans le répertoire de travail
cd /mnt/c/Users/Nicopoup/tutorial/confort

# Définition des variables
room_width=7.52
room_length=8.01
room_height=3.0
total_heat_loss=2814
wall_temperature=18.77
air_temperature=19.23

# Propriétés de base de l'air
# Remplacer les valeurs par celles appropriées
air_density=1.2 # kg/m^3
air_viscosity=1.8e-5 # m^2/s
air_thermal_conductivity=0.026 # W/(m*K)

# Génération de la géométrie
blockMesh

# Configuration des conditions aux limites pour la température
# Les conditions de température sont définies dans le fichier 0/T
# Assurez-vous de remplacer les valeurs par celles appropriées
echo "FoamFile" > 0/T
echo "{" >> 0/T
echo " version 2.0;" >> 0/T
echo " format ascii;" >> 0/T
echo " class volScalarField;" >> 0/T
echo " object T;" >> 0/T
echo "}" >> 0/T
echo >> 0/T
echo "dimensions [0 0 0 1 0 0 0];" >> 0/T
echo >> 0/T
echo "internalField uniform 300;" >> 0/T
echo >> 0/T
echo "boundaryField" >> 0/T
echo "{" >> 0/T
echo " wall" >> 0/T
echo " {" >> 0/T
echo " type fixedValue;" >> 0/T
echo " value uniform $wall_temperature;" >> 0/T
echo " }" >> 0/T
echo " inletOutlet" >> 0/T
echo " {" >> 0/T
echo " type inletOutlet;" >> 0/T
echo " inletValue uniform $air_temperature;" >> 0/T
echo " }" >> 0/T
echo " // Ajouter d'autres conditions aux limites si nécessaire" >> 0/T
echo "}" >> 0/T
echo >> 0/T

# Configuration des conditions aux limites pour la vitesse d'air
# Les conditions de vitesse d'air sont définies dans le fichier 0/U
# Assurez-vous de remplacer les valeurs par celles appropriées

# Configuration des propriétés du fluide
# Propriétés de l'air
echo "transportModel Newtonian;" > constant/transportProperties
echo "nu nu [ 0 2 -1 0 0 0 0 ] $air_viscosity;" >> constant/transportProperties
echo "Pr Pr [ 0 0 0 0 0 0 0 ] 0.7;" >> constant/transportProperties

# Propriétés thermophysiques de l'air
echo "thermalModel Newtonian;" > constant/thermophysicalProperties
echo "rho rho [ 1 -3 0 0 0 0 0 ] $air_density;" >> constant/thermophysicalProperties
echo "Cp Cp [ 0 2 -2 -1 0 0 0 ] 1000;" >> constant/thermophysicalProperties
echo "kappa kappa [ 1 -1 -3 0 0 0 0 ] $air_thermal_conductivity;" >> constant/thermophysicalProperties

# Exécution de la simulation
buoyantSimpleFoam

# Post-traitement des résultats
# Vous pouvez post-traiter les résultats pour extraire des données pertinentes
# telles que la température, la vitesse de l'air, etc.

# Calcul des indices PMV et PPD
postProcess -func 'PMV()' -time 'latestTime'
postProcess -func 'PPD()' -time 'latestTime'

# Visualisation des résultats sur Paraview
paraFoam
Nicopoup is offline   Reply With Quote

Old   March 21, 2024, 11:30
Default
  #3
Member
 
Ching Liu
Join Date: Sep 2017
Posts: 48
Rep Power: 8
qingqingliu is on a distinguished road
Quote:
Originally Posted by Nicopoup View Post
For informations, here's the code I use :


#!/bin/bash

# Définition des chemins vers les exécutables OpenFOAM
# source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc
echo "source /opt/OpenFOAM/OpenFOAM-v2012/etc/bashrc" >> ~/.bashrc
source $HOME/.bashrc

# Se déplacer dans le répertoire de travail
cd /mnt/c/Users/Nicopoup/tutorial/confort

# Définition des variables
room_width=7.52
room_length=8.01
room_height=3.0
total_heat_loss=2814
wall_temperature=18.77
air_temperature=19.23

# Propriétés de base de l'air
# Remplacer les valeurs par celles appropriées
air_density=1.2 # kg/m^3
air_viscosity=1.8e-5 # m^2/s
air_thermal_conductivity=0.026 # W/(m*K)

# Génération de la géométrie
blockMesh

# Configuration des conditions aux limites pour la température
# Les conditions de température sont définies dans le fichier 0/T
# Assurez-vous de remplacer les valeurs par celles appropriées
echo "FoamFile" > 0/T
echo "{" >> 0/T
echo " version 2.0;" >> 0/T
echo " format ascii;" >> 0/T
echo " class volScalarField;" >> 0/T
echo " object T;" >> 0/T
echo "}" >> 0/T
echo >> 0/T
echo "dimensions [0 0 0 1 0 0 0];" >> 0/T
echo >> 0/T
echo "internalField uniform 300;" >> 0/T
echo >> 0/T
echo "boundaryField" >> 0/T
echo "{" >> 0/T
echo " wall" >> 0/T
echo " {" >> 0/T
echo " type fixedValue;" >> 0/T
echo " value uniform $wall_temperature;" >> 0/T
echo " }" >> 0/T
echo " inletOutlet" >> 0/T
echo " {" >> 0/T
echo " type inletOutlet;" >> 0/T
echo " inletValue uniform $air_temperature;" >> 0/T
echo " }" >> 0/T
echo " // Ajouter d'autres conditions aux limites si nécessaire" >> 0/T
echo "}" >> 0/T
echo >> 0/T

# Configuration des conditions aux limites pour la vitesse d'air
# Les conditions de vitesse d'air sont définies dans le fichier 0/U
# Assurez-vous de remplacer les valeurs par celles appropriées

# Configuration des propriétés du fluide
# Propriétés de l'air
echo "transportModel Newtonian;" > constant/transportProperties
echo "nu nu [ 0 2 -1 0 0 0 0 ] $air_viscosity;" >> constant/transportProperties
echo "Pr Pr [ 0 0 0 0 0 0 0 ] 0.7;" >> constant/transportProperties

# Propriétés thermophysiques de l'air
echo "thermalModel Newtonian;" > constant/thermophysicalProperties
echo "rho rho [ 1 -3 0 0 0 0 0 ] $air_density;" >> constant/thermophysicalProperties
echo "Cp Cp [ 0 2 -2 -1 0 0 0 ] 1000;" >> constant/thermophysicalProperties
echo "kappa kappa [ 1 -1 -3 0 0 0 0 ] $air_thermal_conductivity;" >> constant/thermophysicalProperties

# Exécution de la simulation
buoyantSimpleFoam

# Post-traitement des résultats
# Vous pouvez post-traiter les résultats pour extraire des données pertinentes
# telles que la température, la vitesse de l'air, etc.

# Calcul des indices PMV et PPD
postProcess -func 'PMV()' -time 'latestTime'
postProcess -func 'PPD()' -time 'latestTime'

# Visualisation des résultats sur Paraview
paraFoam
Which are line 27 to 28?
qingqingliu is offline   Reply With Quote

Old   March 21, 2024, 11:35
Default File
  #4
New Member
 
Nicolas Poupelin
Join Date: Mar 2024
Posts: 4
Rep Power: 2
Nicopoup is on a distinguished road
Hello, the file in question is:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}

thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState
{
type perfectGas;
}
specie
{
nMoles 1;
molWeight 28.97;
}
energy
{
type sensibleInternalEnergy; // Changed type to sensibleInternalEnergy
specificHeat Cp [ 0 2 -2 -1 0 0 0 ] 1000;
}
}

transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 1.8e-5;

Pr Pr [ 0 0 0 0 0 0 0 ] 0.7;

rho rho [ 1 -3 0 0 0 0 0 ] 1.2;

Cp Cp [ 0 2 -2 -1 0 0 0 ] 1000;

kappa kappa [ 1 -1 -3 0 0 0 0 ] 0.026;
Nicopoup is offline   Reply With Quote

Old   March 21, 2024, 11:58
Default
  #5
Member
 
Ching Liu
Join Date: Sep 2017
Posts: 48
Rep Power: 8
qingqingliu is on a distinguished road
Quote:
Originally Posted by Nicopoup View Post
Hello, the file in question is:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}

thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState
{
type perfectGas;
}
specie
{
nMoles 1;
molWeight 28.97;
}
energy
{
type sensibleInternalEnergy; // Changed type to sensibleInternalEnergy
specificHeat Cp [ 0 2 -2 -1 0 0 0 ] 1000;
}
}

transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 1.8e-5;

Pr Pr [ 0 0 0 0 0 0 0 ] 0.7;

rho rho [ 1 -3 0 0 0 0 0 ] 1.2;

Cp Cp [ 0 2 -2 -1 0 0 0 ] 1000;

kappa kappa [ 1 -1 -3 0 0 0 0 ] 0.026;
Do you try to delete this line"specificHeat Cp [ 0 2 -2 -1 0 0 0 ] 1000;" to see if it helps? It seems that you do not need this line. You have the Cp just above "kappa"
qingqingliu is offline   Reply With Quote

Old   March 21, 2024, 12:32
Default
  #6
New Member
 
Nicolas Poupelin
Join Date: Mar 2024
Posts: 4
Rep Power: 2
Nicopoup is on a distinguished road
I've just tried it and unfortunately it didn't work.
Nicopoup 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
Issue on zeroGradient BC for system rotation magnushaese OpenFOAM Running, Solving & CFD 2 January 28, 2022 13:43
Request for dictionary failed with buoyantSimpleFoam sturgeon OpenFOAM Running, Solving & CFD 4 January 21, 2021 06:26
rhoCentralFoam inviscid airfoil issue (Foam::error::printStack(Foam::Ostream&) at ??) kmkb21 OpenFOAM Running, Solving & CFD 1 March 1, 2018 01:07
Simulation of Water with buoyantSimpleFoam possible? BenFranklinIII OpenFOAM Running, Solving & CFD 0 July 24, 2015 05:57
Pressure boundary condition issue Vijay FLUENT 0 April 6, 2012 13:35


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