CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Write Cp (http://www.cfd-online.com/Forums/openfoam-solving/60103-write-cp.html)

tangd July 25, 2006 08:14

If I want to write the Cp ever
 
If I want to write the Cp every writeInterval, how do I change the code below:

template<class>
tmp<volscalarfield> hThermo<mixturetype>::Cp() const
{
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)
)
);

The obove was extracted from hThermo.C which I think is responsible for writing the value into the Cp file after a writeInterval. So by referencing other variable like p or T. I changed IOobject::NO_WRITE into IOobject::AUTO_WRITE. But still not saw Cp. How do I change the code correctly? Thank you so much!

tangd July 25, 2006 09:48

By the way, I clarify my quest
 
By the way, I clarify my question. I'm using sonicTurbFoam and I set the thermoType as

hThermo<puremixture<sutherlandtransport<speciether mo<janafthermo<perfectgas>>>>> ;

The current situation is that after running a case, I intend to use postprocessing method like calcMassFlow or something like that to output the Cp value as well as h. My idea is that to read the Cp value from for example "0.003" directory. But the prerequisite must be that I write the Cp data into a file called Cp the same as p, T, U and so on. I also took a look at the basicThermo.C and .H, but I cannot move forward now, can someone give me a hand? Thanks!


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