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

Get access to temperature in Openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 8, 2013, 08:59
Question Get access to temperature in Openfoam
  #1
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 13
hz283 is on a distinguished road
Hi All,

In rhoPimpleFoam, the total enthalpy is solved and based on that the temperature is updated. In creteFields, the enthalpy is defined as

autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();

volScalarField& p = thermo.p();
volScalarField& h = thermo.h();

I checked the enthalpy function h() in basicThermo.C and found the following:

Foam::volScalarField& Foam::basicThermo::h()
{
notImplemented("basicThermo::h()");
return const_cast<volScalarField&>(volScalarField::null() );
}


There are other three enthalpy function definitions for h(), but the above one should be for the case where the enthalpy is solved as the governing equation.

I checked this because for my own work, I would like to update the temperature not through openfoam's enthalpy equation but through my own model (not solve the energy equations in Openfoam). So should I add the lines for T() as follows in basicThermo.C?

Foam::volScalarField& Foam::basicThermo::T()
{
notImplemented("basicThermo::T()");
return const_cast<volScalarField&>(volScalarField::null() );
}

Actually I also find that some other declare the temperature as follows ():

Info<< "Reading field T\n" <<endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh );

Which one is correct for temperature update?

Does anybody know something about this? Thanks.
Kummi likes this.
hz283 is offline   Reply With Quote

 


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
Problem with zeroGradient wall BC for temperature - Total temperature loss cboss OpenFOAM 12 October 1, 2018 06:36
Implementation of maxwell slip velocity and Temperature jump with openfoam yassepid OpenFOAM 2 June 28, 2016 07:05
coldEngineFoam (OpenFoam 2.1.x), constant Temperature during adiabatic compression novakm OpenFOAM Verification & Validation 1 February 25, 2013 12:25
Inlet won't apply UDF and has temperature at 0K! tccruise Fluent UDF and Scheme Programming 2 September 14, 2012 06:08
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25


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