|
[Sponsors] |
July 22, 2015, 23:35 |
Custom Thermophysical Properties
|
#1 |
New Member
Walter
Join Date: Feb 2011
Posts: 8
Rep Power: 15 |
I am trying to implement arbitrary thermophysical properties for all major quantities (rho, mu, alpha, cp, h, etc...) for sensitivity studies.
It seems the easiest way to do this is by cloning the thermo class rhoThermo/heRhoThermo and implementing the properties there. Before you ask, I cant/dont want to implement the properties at the solver level because then I cant arbitrarily take advantage of them in the turbulence models (unless you can tell me how... which would be great!). Attached is a modified heRhoThermo (now heArbThermo, sub class of arbThermo). The code compiles (OF230) and can be added to the buoyantPimpleFoam solver, but running the hotRoom tutorial case (with max temperatures modified to be ~ 375K to match the fake properties) diverges in about 100 iterations and looks like it blows up in the turbulence properties. There is a bit of a hack in heArbThermo in that the enthalpy (assumed to be the instantiated quantity for the energy transport equation) is re-calculated so that the original invocation of the thermo class calculation of "h" is overwritten. This is not ideal mostly because it only allows constant T boundary conditions. I tried digging deeper into the thermo models, such as icoPoly/hPoly/poly/etc. but I cant actually tell how the properties are calculated there. for instance... what does "this->W()" mean? I am sure that modifying these would be more robust/elegant. Does anyone have any thoughts on why the attached when used with the buoyantPimpleFoam/hotRoom tutorial blows up? I know the properties are non-sense, but this is a MWE for clarity. Thanks, -w. ps... if you are going to re-compile buoyantPimpleFoam to use these remember to add the following to your make files in addition to changing all references of rhoThermo to arbThermo: to the end of EXE_INC: -I<your openfoam user dir here>/src/thermophysicalModels/basic/lnInclude and to the end of EXE_LIBS: -L$(FOAM_USER_LIBBIN) \ -larbFluidThermo |
|
July 23, 2015, 10:48 |
|
#2 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 |
I haven't looked into your code, but there are two thermophysical libraries on the forum using tabular data, one of which was developed by me. See here: http://www.cfd-online.com/Forums/ope...rmo-model.html
Speaking for my library, I got rid of the manual inversion for temperature calculation, because it is slow and possibly unstable when a direct enthalpy,pressure->temperature mapping is available. |
|
July 24, 2015, 13:14 |
|
#3 |
New Member
Walter
Join Date: Feb 2011
Posts: 8
Rep Power: 15 |
Thanks! that is a great starting point. I downloaded your version (i will look at the other one too eventually) and tried to compile it.
I tried. i have tried both compiling it from the $FOAM_RUN directory and even from just copying over the functions that exist in the $FOAM_SRC/thermophysical directory. I have tried it with both OF230 and OF24x the error shown below is pretty similar across the board. am i missing something? + wmake libso basic Making dependency list for source file psiThermo/psiThermos.C could not open file specie.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file perfectGas.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file PengRobinsonGas.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file tabulated.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file hConstThermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file eConstThermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file janafThermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file sensibleEnthalpy.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file sensibleInternalEnergy.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file thermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file tabulatedThermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file constTransport.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file sutherlandTransport.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file tabulatedTransport.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file hPolynomialThermo.H for source file psiThermo/psiThermos.C due to No such file or directory could not open file polynomialTransport.H for source file psiThermo/psiThermos.C due to No such file or directory Making dependency list for source file rhoThermo/rhoThermos.C could not open file specie.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file perfectGas.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file incompressiblePerfectGas.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file rhoConst.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file perfectFluid.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file PengRobinsonGas.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file adiabaticPerfectFluid.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file tabulated.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file hConstThermo.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file janafThermo.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file sensibleEnthalpy.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file sensibleInternalEnergy.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file thermo.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file tabulatedThermo.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file constTransport.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file sutherlandTransport.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file tabulatedTransport.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file icoPolynomial.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file hPolynomialThermo.H for source file rhoThermo/rhoThermos.C due to No such file or directory could not open file polynomialTransport.H for source file rhoThermo/rhoThermos.C due to No such file or directory Making dependency list for source file derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C Making dependency list for source file rhoThermo/rhoThermo.C Making dependency list for source file psiThermo/psiThermo.C Making dependency list for source file basicThermo/basicThermo.C SOURCE=basicThermo/basicThermo.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/finiteVolume/lnInclude -I/root/OpenFOAM/root-2.3.0/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/OpenFOAM/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/basicThermo.o SOURCE=fluidThermo/fluidThermo.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/finiteVolume/lnInclude -I/root/OpenFOAM/root-2.3.0/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/OpenFOAM/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/fluidThermo.o SOURCE=psiThermo/psiThermo.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/finiteVolume/lnInclude -I/root/OpenFOAM/root-2.3.0/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/OpenFOAM/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/psiThermo.o SOURCE=psiThermo/psiThermos.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/finiteVolume/lnInclude -I/root/OpenFOAM/root-2.3.0/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -I/opt/openfoam230/src/OpenFOAM/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/psiThermos.o psiThermo/psiThermos.C:29:20: fatal error: specie.H: No such file or directory compilation terminated. make: *** [Make/linux64GccDPOpt/psiThermos.o] Error 1 |
|
July 27, 2015, 06:37 |
|
#4 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 |
You need to run "wmakeLnInclude ." first, to generate the links in the lnInclude directory. This is a standard procedure for OpenFOAM. It should also suffice to simply execute wmake without any arguments, as the type of the build is determined by the makefile now.
|
|
June 1, 2023, 15:30 |
Using thermo with customized TEqn
|
#5 |
New Member
Snigdha
Join Date: Jun 2021
Posts: 5
Rep Power: 0 |
I am trying to develop a customized solver to solve some counter current packed bed and reaction problems. I am using rhosimpleFoam as the base solver on which I am trying to modify. I am interested to solve my own TEqn than the Eeqn . Can I still use thermo library to update rho?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error in thermophysical properties (chtMultiRegionFoam) | mukut | OpenFOAM Pre-Processing | 28 | November 23, 2021 07:34 |
heat transfer simulation in a tube with the variations of thermophysical properties | Gary51075607 | OpenFOAM | 0 | January 12, 2015 09:36 |
confused with units in solidThermophysical properties and Thermophysical properties | zahraa | OpenFOAM Running, Solving & CFD | 3 | August 14, 2014 09:11 |
table properties for thermophysical properties | romant | OpenFOAM Running, Solving & CFD | 1 | August 12, 2014 09:41 |
Thermophysical properties for natural convection | Ciefdi | OpenFOAM Running, Solving & CFD | 0 | November 7, 2013 12:44 |