CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

difference between thermo.T() and T

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

LinkBack Thread Tools Display Modes
Old   December 4, 2013, 08:39
Default difference between thermo.T() and T
New Member
Join Date: Feb 2012
Posts: 25
Rep Power: 7
Marshak is on a distinguished road
Can someone tell me what is the difference between defining

volScalarField myTemperature = thermo.T()
volScalarField mypressure = thermo.p()


const volScalarField& myTemperature = mesh_.lookupObject<volScalarField>("T");
const volScalarField& mypressure= mesh_.lookupObject<volScalarField>("p");
Marshak is offline   Reply With Quote

Old   December 4, 2013, 09:45
Senior Member
dkxls's Avatar
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 12
dkxls will become famous soon enough
Typically, in a solver that solves an energy equation (e.g. rhoPimpleFoam), the temperature is defined in the thermo class (see basicThermo.H).
You can access the field like this
const volScalarField& T = thermo.T();
(see e.g. createFields.H in the reactingFoam)

So, if you didn't implement some extra volScalarField named "T" (not quite sure if it is even possible to define two fields with the same same in the object registry), you should also be able to get access to the same field by looking it up from the object registry like this
const volScalarField& T = mesh.lookupObject<volScalarField>("T");
Note that you only get a const access to "T" from "thermo.T()".
dkxls is offline   Reply With Quote


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
high-order difference in OpenFOAM rxgrch OpenFOAM Programming & Development 5 October 10, 2016 23:48
Periodic Boundary Condition for upwind difference yohey44 Main CFD Forum 0 October 27, 2010 13:10
paraview - plotting difference to reference data joewe ParaView 0 August 30, 2010 18:01
Difference between scaled residuals and... Dieter FLUENT 0 April 28, 2006 17:52
Fininte difference and Finite element Technique Mahendra Singh Mehra FLUENT 3 December 23, 2005 00:49

All times are GMT -4. The time now is 12:14.