CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   how to output hi in OpenFoam (https://www.cfd-online.com/Forums/openfoam/93690-how-output-hi-openfoam.html)

yiwang25 October 24, 2011 05:56

how to output hi in OpenFoam
 
hello,everyone

In Openfoam, How to output speices specific enthalpy hi?
Any comments, please

mturcios777 October 24, 2011 13:12

Read this section of the manual on run time code compilation:

http://www.openfoam.com/version2.0.0...me-control.php

In the source code for a particular solver you specify which fields to write out when they are created, usually createFields.C. If you want the specific enthalpy of each species, you need to execute code at run-time that will write out the h field for every field i. Most likely you need to create a reference to each field with its own name (in a forAll loop) and then execute an hi.write(). You'll have to specify an interval at which these fields will be written.

yiwang25 October 27, 2011 05:31

Quote:

Originally Posted by mturcios777 (Post 329216)
Read this section of the manual on run time code compilation:

http://www.openfoam.com/version2.0.0...me-control.php

In the source code for a particular solver you specify which fields to write out when they are created, usually createFields.C. If you want the specific enthalpy of each species, you need to execute code at run-time that will write out the h field for every field i. Most likely you need to create a reference to each field with its own name (in a forAll loop) and then execute an hi.write(). You'll have to specify an interval at which these fields will be written.

mturcios777:

Thank you very much! would you like to show me an example?

mturcios777 October 27, 2011 14:57

Of the top of my head, it seems like you'll need something like this:

Code:

label specName;

foAll(h,speci)
{
    specName = h[i].name();

    volScalarField hiTemp
    (
    IOobject
    (
        specName,
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
        ),
    h[i]
    );

    hiTemp.write();
}

Not being super familiar with runTime post-processing, I'm not exactly sure where this should be located, but it seems like you should try adapt the fourth example on the OpenFOAM page I linked earlier (the one that calculated the average pressure). Change the outputControl to something that will write at the writeInterval (don't know what the option is, it may well be writeInterval). Good luck

yiwang25 October 28, 2011 05:16

Thanks a lot. I will try

fezh January 31, 2012 06:02

Do you have find h_i of the species? And how? Thanks.


All times are GMT -4. The time now is 01:02.