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

Adding New thermophysicalModel to OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2021, 08:18
Default Adding New thermophysicalModel to OpenFOAM
  #1
New Member
 
Join Date: May 2021
Posts: 2
Rep Power: 0
abhishek_2k20 is on a distinguished road
Hi guys,

I am in dire need of help. Please help me with this. I am tyring to add a new transport model in thermophysicalModel which takes input as a csv file and converts it to interpolation table(mu vs T). I am using chtMultiRegionFoam. I made my own Model in specie/transport with all kinds of operator overloading functions. I did linking properly of new "mySpecie" and "myBasic". I defined the thermophysicsType (typedef <>) for my new model, I defined new rhoThermo type.
After compiling, when I use new thermophysical model, it throws an error and the list of thermo-types it shows doesn't even show my model. when I implemented same in rhoReaction and repeat all previous steps, It shows in the list of thermophysical models which the OpenFOAM throws.

Any Idea about where I'll be missing?
abhishek_2k20 is offline   Reply With Quote

Old   May 20, 2021, 13:00
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 735
Rep Power: 14
Tobermory will become famous soon enough
If your new model is not listed as an option, then your model changes have clearly not loaded. Perhaps you missed a reference to your new library in controlDict? Just check carefully, and methodically through each step that you have taken and maybe you will find the error.

To be honest, you have provided so little information about what you have done that it is impossible to help you ...
Tobermory is offline   Reply With Quote

Old   May 21, 2021, 02:16
Default
  #3
New Member
 
Join Date: May 2021
Posts: 2
Rep Power: 0
abhishek_2k20 is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
If your new model is not listed as an option, then your model changes have clearly not loaded. Perhaps you missed a reference to your new library in controlDict? Just check carefully, and methodically through each step that you have taken and maybe you will find the error.

To be honest, you have provided so little information about what you have done that it is impossible to help you ...

Sorry! I have pasted here some snippet. Please see if you can find issue.

Thanks!


Here is the snippet of myThermophysicalModels/mySpecie/include/thermophysicsType.H :
Code:
#include "pcmTransport.H"

typedef
    pcmTransport
    <
        species::thermo
        <
            hConstThermo
            <
                perfectGas<specie>
            >,
            sensibleEnthalpy
        >
    > PCMTransport;
here is the snippet of mySpecie/Make/file:

Code:
atomicWeights/atomicWeights.C
mySpecie/specie.C
reaction/reactions/makeReactions.C
reaction/reactions/makeLangmuirHinshelwoodReactions.C
reaction/reactions/makeMichaelisMentenReactions.C
LIB = $(FOAM_USER_LIBBIN)/libspecie
here is the snippet of mySpecie/Make/options:
Code:
EXE_INC = \
	-I$(WM_PROJECT_USER_DIR)/src/my_lib/lnInclude \
	-I$(LIB_SRC)/finiteVolume/lnInclude \
	-I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = -lOpenFOAM \
	   -L$(FOAM_USER_LIBBIN) \
           -lcsvReader \
	   -lfiniteVolume \
           -lmeshTools
here is the snippet of myBasic/rhoThermo/rhoThermos:

Code:
#include "pcmTransport.H" // rest of necessary files are already included

makeThermos
(
    rhoThermo,
    heRhoThermo,
    pureMixture,
    pcmTransport,
    sensibleEnthalpy,
    hConstThermo,
    perfectGas,
    specie
);
here is the snippet of myBasic/Make/file:
Code:
myBasicThermo/myBasicThermo.C
fluidThermo/fluidThermo.C

psiThermo/psiThermo.C
psiThermo/psiThermos.C

rhoThermo/rhoThermo.C
rhoThermo/rhoThermos.C
rhoThermo/liquidThermo.C

derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C
derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C
derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C

derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C
derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C

LIB = $(FOAM_USER_LIBBIN)/libfluidThermophysicalModels

here is the snippet of myBasic/Make/option:

Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/my_lib/lnInclude \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/mySpecie/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/thermophysicalProperties/lnInclude 
    

LIB_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lcsvReader \
    -lspecie \
    -lcompressibleTransportModels \
    -lfiniteVolume \
    -lmeshTools

and finally, here is the snippet of chtMultiRegionFoam's Make/option:

Code:
EXE_INC = \
    -I. \
    -I./fluid \
    -I./solid \
    -I./porousFluid \
    -I./porousSolid \
    -I./include \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/finiteVolume/cfdTools \
    -I$(WM_PROJECT_USER_DIR)/src/my_lib/lnInclude \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myBasic/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/mySpecie/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myReactionThermo/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/mySolidThermo/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myChemistryModel/lnInclude \
    -I$(LIB_SRC)/ODE/lnInclude \
    -I$(LIB_SRC)/combustionModels/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/myTurbulenceModels/turbulenceModels/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/myTurbulenceModels/compressible/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myRadiation/lnInclude \
    -I$(LIB_SRC)/regionModels/regionModel/lnInclude


EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lcsvReader \
    -lcompressibleTransportModels \
    -lfluidThermophysicalModels \
    -lspecie \
    -lreactionThermophysicalModels \
    -lsolidThermo \
    -lchemistryModel \
    -lODE \
    -lcombustionModels \
    -lturbulenceModels \
    -lcompressibleTurbulenceModels \
    -lmeshTools \
    -lfiniteVolume \
    -lradiationModels \
    -lfvOptions \
    -lregionModels \
    -lsampling
abhishek_2k20 is offline   Reply With Quote

Reply

Tags
openfoam, openfoam programming, thermophysical model, transportmodels


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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
multiRegionHeater error ordinary OpenFOAM Running, Solving & CFD 2 June 9, 2020 18:43
OpenFOAM Training Beijing 22-26 Aug 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 May 3, 2016 05:57
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 39 March 31, 2016 09:43
Adding Radiation Sub-models into OpenFOAM 1.5 shajitah OpenFOAM 0 September 13, 2010 22:26


All times are GMT -4. The time now is 03:47.