CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   rhoCentralFOAM: Thermophysical properties. Gamma definition (https://www.cfd-online.com/Forums/openfoam-programming-development/129485-rhocentralfoam-thermophysical-properties-gamma-definition.html)

AshwaniAssam February 6, 2014 06:34

rhoCentralFOAM: Thermophysical properties. Gamma definition
 
Hi all,
In createFields.h file under rhoCentralFOAM the following are the initial lines:

Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();

volScalarField& p = thermo.p();
volScalarField& e = thermo.e();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
const volScalarField& mu = thermo.mu();


Can anyone please explain some terms like thermo. Also, I want to define gamma = Cp/Cv. I am not able to figure this how to do. I used the following

const volScalarField& gamma = thermo.Cp() / thermo.Cv();
Info<<"GAMMA= "<< gamma <<"\n" <<endl;
But it fails saying hanging pointer while executing the Info line.
a part of logfile:


1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
1.4
)
;

boundaryField
{


--> FOAM FATAL ERROR:
hanging pointer, cannot dereference

From function PtrList::operator[] const
in file /home/Ashwani/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/PtrListI.H at line 134.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/home/Ashwani/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/Ashwani/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/errorManip.H:85
#3 Foam::PtrList<Foam::fvPatchField<double> >::operator[](int) const at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/PtrListI.H:139
#4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::writeEntry (Foam::word const&, Foam::Ostream&) const at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:461
#5 Foam::Ostream& Foam::operator<< <double, Foam::fvPatchField, Foam::volMesh>(Foam::Ostream&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricField.C:1237
#6
at ~/OpenFOAM/Ashwani-2.1.1/rhoAUSM/rhoAUSM.C:56
#7 __libc_start_main in "/lib64/libc.so.6"
#8
in "/home/Ashwani/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/rhoAUSM"
Aborted (core dumped)



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