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

JANAF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 18, 2006, 06:02
Default Hi all, I have a question rel
  #1
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Hi all,
I have a question related to "janaf". I searched the janaf keyword in the message board and found that the janaf is aimed to handle some complicated boundary conditions. I guess it can be used to define the temperature dependent Cp, am I right? If so, how do I use it correctly? Thanks!
tangd is offline   Reply With Quote

Old   July 19, 2006, 03:20
Default Now I know how to use the jana
  #2
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Now I know how to use the janaf table, which is described in Chapter 8.1 of user guide. But at the same time, a new question arises. Where is the computed value of Cp stored? Since I want to output the Cp value and use it for other purposes.
tangd is offline   Reply With Quote

Old   July 19, 2006, 08:47
Default If you look in "createFields.H
  #3
Member
 
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 9
david_h is on a distinguished road
If you look in "createFields.H" from reactingFoam or one of the other combustion applications an instance of the thermodynamic class named "thermo" is created. The specific heat of the fluid can be extracted using:

thermo->Cp();

Note that this calculates the specific heat of the mixture in contrast to other functions such as, thermo->h() or thermo->p(), which return references to internal variables of "thermo" or copy the data from the internal variables.

The relevant class definitions are in:
/src/thermophysicalModels/combustion/hCombustionThermo
/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo and hhuMixtureThermo
david_h is offline   Reply With Quote

Old   July 19, 2006, 09:39
Default Thanks for your quick reply. H
  #4
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Thanks for your quick reply. Here I clarify my question more, I tried to implement the totalTemperature B.C. where the total temperature equation has the term Cp, so I want to extract the value of Cp from somewhere in the code. Since the code of my boundary condition locates in src/finiteVolume/fields/fvPatchFields/derivedFvPatchFields/timeVaryingUniformTot alPressure, if I used #include "createFields.H", it is obvious not correct. So I need to ask you further how I get the Cp value. Thank you so much for your help.
tangd is offline   Reply With Quote

Old   July 19, 2006, 10:50
Default If I understand your question,
  #5
Member
 
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 9
david_h is on a distinguished road
If I understand your question, you need to find a way to get to the information from the "thermo" object into a "timeVaryingUniformTotalPressure" object.

The boundary conditions for enthalpy(h) require access to the thermo class since the boundary conditions are specified during model setup in terms of the species mass fractions and temperature. The function "fixedEnthalpyFvPatchScalarField::updateCoeffs ()" in the directory: "./src/thermophysicalModels/basic/derivedFvPatchFields"

has a statement which starts:

const basicThermo& thermo =
db().lookupObject<basicthermo>

I would guess that this functionality could be adapted for you problem to get the thermo object you need to get Cp.
david_h is offline   Reply With Quote

Old   July 19, 2006, 12:59
Default Thanks for your information, I
  #6
New Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 1
Rep Power: 0
dihao is on a distinguished road
Thanks for your information, I will try this functionality tomorrow.
Additionally, I'm thinking about the use of overloading operator, since I don't have any experience in C++. In totalPressure code, I found that the static pressure is represented by operator which is:
operator==(p0_/(1.0+0.5*psi*(1.0-pos(phip))*magSqr(Up))). So let's assume the operator is assigned a value, then this value should be also used by other objects. If it is the case, how is the value passed to other objects? I think the mechanism is somewhat similar to my case. Forgive my poor C++ skills. Thanks again by the way!
dihao is offline   Reply With Quote

Old   July 20, 2006, 08:37
Default Thanks, you are right! I inclu
  #7
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Thanks, you are right! I included the basicThermo library into the Make/options, then I can pass value between two objects. For the sake of safety, can you check for me to see if it is right?

I implemented like this, first defined:

const basicThermo& thermo = db().lookupObject<basicthermo>

and then access the Cp by using thermo.Cp()(not ->, because thermo doesn't have this member). I inspected myself by outputting the Cp values while using different temperature values, I found the Cp value varied.
tangd is offline   Reply With Quote

Old   July 20, 2006, 10:39
Default Great, glad it works. You
  #8
Member
 
E. David Huckaby
Join Date: Mar 2009
Posts: 57
Rep Power: 9
david_h is on a distinguished road
Great,
glad it works.

You have to use the dot operator(".") because basicThermo is "reference" to an object. The "->" operator is for a "pointer" to an object.
david_h is offline   Reply With Quote

Old   July 21, 2006, 05:07
Default Unfortunately, there is a new
  #9
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Unfortunately, there is a new problem due to the new inserted basicThermo library into the src/finiteVolume/Make/options, a lot of errors were created. One of them is listed below if I made recompilation:

g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread Make/linuxGcc4DPOpt/sonicLiquidFoam.o -L/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt \
-lfiniteVolume -lOpenFOAM -liberty -o /workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/soni cLiquidFoam
/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt/libbasicThermophy sicalModels.so: undefined reference to `Foam::specie::Tstd'
/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt/libbasicThermophy sicalModels.so: undefined reference to `Foam::specie::RR'
/workdir/flux1/e7gast/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt/libbasicThermophy sicalModels.so: undefined reference to `Foam::perfectGas::perfectGas(Foam::Istream&)'
collect2: ld returned 1 exit status

It seems that this new insert affected a lot of objects. Sorry to bother you once again. Do you know how to fix this problem? Thank you very much!
tangd is offline   Reply With Quote

Old   July 21, 2006, 07:06
Default Hmmm, the problem is now solve
  #10
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
Hmmm, the problem is now solved which was caused by not including the libspecie. So it complained that "undefined reference to `Foam::specie::Tstd'". After adding this library in the make file, I restarted the Allwmake, now it looks fine!
tangd is offline   Reply With Quote

Old   July 26, 2006, 03:25
Default While we are on the topic of j
  #11
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 780
Rep Power: 19
olesen will become famous soon enough
While we are on the topic of janaf ...

1) Is there a numerical/historical/philosophical reason that OpenFOAM uses a 5 coefficient form instead of the 7 coefficient JANAF form favoured by NASA Glenn?

2) Assuming that my viscosity variations are important and the Cp variants are secondary, is there any particular reason that the combination sutherlandTransport and hConstThermo are not defined?

eg,
hThermo<puremixture<sutherlandtransport<speciether mo<hconstthermo<perfectgas>>>> >;

Thanks,
/mark
olesen is offline   Reply With Quote

Old   July 26, 2006, 03:39
Default Heya, (don't know the first
  #12
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,783
Rep Power: 22
hjasak will become famous soon enough
Heya,

(don't know the first answer). On the second, the software is assembled throught templates for efficiency in this way and you should be able to instantiate any combination of models that you need to do. In short, the combination you mention has not been instantiated simply because nobody needed it so far - you should be able to do it yourself without problems.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 26, 2006, 04:26
Default If I want the Cp value to be w
  #13
Member
 
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 9
tangd is on a distinguished road
If I want the Cp value to be written into the time file, say "0.01", how do I change the code? I think I should use something similar to this structure which is found from hThermo.C:

const fvMesh& mesh = T_.mesh();

tmp<volscalarfield> tCp
(
new volScalarField
(
IOobject
(
"Cp",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionSet(0, 2, -2, -1, 0)
)
);

I tried to change IOobject::NO_WRITE into IOobject::AUTO_WRITE, but it doesn't work as I expected. Please give me some suggestion how to use it. Thanks!
tangd 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
DieselFoam and temperature out of janaf range hoogland OpenFOAM Running, Solving & CFD 5 January 28, 2016 13:30
Janaf Tables Mark Main CFD Forum 2 July 4, 2011 11:57
Inverted Janaf formula gianpaolo CFX 2 October 1, 2007 05:13


All times are GMT -4. The time now is 18:28.