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

Custom Thermophysical Properties

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 22, 2015, 22:35
Default Custom Thermophysical Properties
  #1
New Member
 
Walter
Join Date: Feb 2011
Posts: 8
Rep Power: 7
wsmith02 is on a distinguished road
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
Attached Files
File Type: gz arbThermo.tar.gz (5.1 KB, 2 views)
wsmith02 is offline   Reply With Quote

Old   July 23, 2015, 09:48
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 331
Rep Power: 6
chriss85 is on a distinguished road
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: Tabulated fluid thermo model

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.
chriss85 is offline   Reply With Quote

Old   July 24, 2015, 12:14
Default
  #3
New Member
 
Walter
Join Date: Feb 2011
Posts: 8
Rep Power: 7
wsmith02 is on a distinguished road
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
wsmith02 is offline   Reply With Quote

Old   July 27, 2015, 05:37
Default
  #4
Senior Member
 
Join Date: Oct 2013
Posts: 331
Rep Power: 6
chriss85 is on a distinguished road
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.
chriss85 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in thermophysical properties (chtMultiRegionFoam) mukut OpenFOAM Pre-Processing 24 November 23, 2015 09:17
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 08:11
table properties for thermophysical properties romant OpenFOAM Running, Solving & CFD 1 August 12, 2014 08:41
Thermophysical properties for natural convection Ciefdi OpenFOAM Running, Solving & CFD 0 November 7, 2013 12:44


All times are GMT -4. The time now is 04:06.