CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Using a Different Thermodynamics Package with the chtMultiRegionFoam Solver (http://www.cfd-online.com/Forums/openfoam/77469-using-different-thermodynamics-package-chtmultiregionfoam-solver.html)

m.nichols19 June 23, 2010 16:23

Using a Different Thermodynamics Package with the chtMultiRegionFoam Solver
 
Hello and thanks in advance!

I am attempting to model liquid water flowing through a steel pipe using the chtMultiRegionFoam solver. Everything is going rather well except for one issue: the thermodynamics package I selected is not valid for the solver.

I modified the hPsiThermos.C and basicMixtures.C files, but the solver still does not recognize the thermodynamics package. I probably need to modify one or two more files, but I can't figure out which ones.

The following files are thermophysicalProperties, hPsiThermos.C, basicMixtures.C, and log.chtMultiRegionFoam, respectively:

thermophysicalProperties
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType      hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>;

mixture        liquid 1 18.0 4180 6010 8.9e-04 6.2;

// ************************************************************************* //

hPsiThermos.C
Code:

\*---------------------------------------------------------------------------*/

#include "makeBasicPsiThermo.H"

#include "icoPolynomial.H"
#include "perfectGas.H"

#include "hConstThermo.H"
#include "janafThermo.H"
#include "specieThermo.H"

#include "constTransport.H"
#include "sutherlandTransport.H"

#include "hPsiThermo.H"
#include "pureMixture.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    constTransport,
    hConstThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    sutherlandTransport,
    hConstThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    sutherlandTransport,
    janafThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    constTransport,
    hConstThermo,
    icoPolynomial
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// ************************************************************************* //

basicMixtures.C
Code:

\*---------------------------------------------------------------------------*/

#include "error.H"

#include "basicMixture.H"
#include "makeBasicMixture.H"

#include "icoPolynomial.H"
#include "perfectGas.H"

#include "eConstThermo.H"

#include "hConstThermo.H"
#include "janafThermo.H"
#include "specieThermo.H"

#include "constTransport.H"
#include "sutherlandTransport.H"

#include "pureMixture.H"

#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

makeBasicMixture
(
    pureMixture,
    constTransport,
    hConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    hConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    constTransport,
    eConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    eConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    janafThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    constTransport,
    hConstThermo,
    icoPolynomial
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// ************************************************************************* //

log.chtMultiRegionFoam
Code:

Build  : 1.6-53b7f692aa41
Exec  : chtMultiRegionFoam
Date  : Jun 23 2010
Time  : 14:58:23
Host  : elderville
PID    : 14014
Case  : /home/mattn/OpenFOAM/mattn-1.6/run/thisOneWorks2
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create fluid mesh for region water for time = 0.001

Create solid mesh for region tube for time = 0.001

*** Reading fluid mesh thermophysical properties for region water

    Adding to thermoFluid

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>


Unknown basicPsiThermo type hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>

Valid basicPsiThermo types are:

8
(
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<eConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
)



    From function basicPsiThermo::New(const fvMesh&)
    in file psiThermo/basicPsiThermo/newBasicPsiThermo.C at line 64.

FOAM exiting


m.nichols19 June 24, 2010 16:54

I was using the wrong executable that had not been changed. I'll update my status once I resolve this error.

VdG July 8, 2010 08:33

Hello Matt,

did you manage to get the solver running? I am trying to do the same thing: have an incompressible liquid in one part of the domain and a compressible gas in the other part. I tried to change the solver using the modifications you mention, but it doesn't compile:

basicMixtures.C:97: error: type/value mismatch at argument 1 in template parameter list for ‘template<class equationOfState> class Foam::hConstThermo’

Any help is appreciated.

marval October 21, 2010 07:25

Any succes Matt?

I just need water for my simulation but don't know how to change the thermohysicalProperties file.

m.nichols19 October 21, 2010 17:33

Hello marval,

I regretfully did not.

Here is a link to my completed project if that is of any assistance:

http://www.cfd-online.com/Forums/ope...-no-catch.html

best regards,
Matt

juho October 22, 2010 09:05

In the 1.7.x version, the chtMultiRegionFoam and chtMultiRegionSimpleFoam have recently been modified to use hRhoThermo, which allows icoPolynomial equation of state and thus simulation of liquid flows.

Check Henry's commits 14.-15.10.2010:
http://github.com/OpenCFD/OpenFOAM-1.7.x/commits/master

karthik1414 March 15, 2011 08:32

Quote:

Originally Posted by m.nichols19 (Post 264253)
Hello and thanks in advance!

I am attempting to model liquid water flowing through a steel pipe using the chtMultiRegionFoam solver. Everything is going rather well except for one issue: the thermodynamics package I selected is not valid for the solver.

I modified the hPsiThermos.C and basicMixtures.C files, but the solver still does not recognize the thermodynamics package. I probably need to modify one or two more files, but I can't figure out which ones.

The following files are thermophysicalProperties, hPsiThermos.C, basicMixtures.C, and log.chtMultiRegionFoam, respectively:

thermophysicalProperties
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType      hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>;

mixture        liquid 1 18.0 4180 6010 8.9e-04 6.2;

// ************************************************************************* //

hPsiThermos.C
Code:

\*---------------------------------------------------------------------------*/

#include "makeBasicPsiThermo.H"

#include "icoPolynomial.H"
#include "perfectGas.H"

#include "hConstThermo.H"
#include "janafThermo.H"
#include "specieThermo.H"

#include "constTransport.H"
#include "sutherlandTransport.H"

#include "hPsiThermo.H"
#include "pureMixture.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    constTransport,
    hConstThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    sutherlandTransport,
    hConstThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    sutherlandTransport,
    janafThermo,
    perfectGas
);

makeBasicPsiThermo
(
    hPsiThermo,
    pureMixture,
    constTransport,
    hConstThermo,
    icoPolynomial
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// ************************************************************************* //

basicMixtures.C
Code:

\*---------------------------------------------------------------------------*/

#include "error.H"

#include "basicMixture.H"
#include "makeBasicMixture.H"

#include "icoPolynomial.H"
#include "perfectGas.H"

#include "eConstThermo.H"

#include "hConstThermo.H"
#include "janafThermo.H"
#include "specieThermo.H"

#include "constTransport.H"
#include "sutherlandTransport.H"

#include "pureMixture.H"

#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */

makeBasicMixture
(
    pureMixture,
    constTransport,
    hConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    hConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    constTransport,
    eConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    eConstThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    sutherlandTransport,
    janafThermo,
    perfectGas
);

makeBasicMixture
(
    pureMixture,
    constTransport,
    hConstThermo,
    icoPolynomial
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// ************************************************************************* //

log.chtMultiRegionFoam
Code:

Build  : 1.6-53b7f692aa41
Exec  : chtMultiRegionFoam
Date  : Jun 23 2010
Time  : 14:58:23
Host  : elderville
PID    : 14014
Case  : /home/mattn/OpenFOAM/mattn-1.6/run/thisOneWorks2
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create fluid mesh for region water for time = 0.001

Create solid mesh for region tube for time = 0.001

*** Reading fluid mesh thermophysical properties for region water

    Adding to thermoFluid

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>


Unknown basicPsiThermo type hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<icoPolynomial>>>>>

Valid basicPsiThermo types are:

8
(
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<eConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>
ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
hPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>
)



    From function basicPsiThermo::New(const fvMesh&)
    in file psiThermo/basicPsiThermo/newBasicPsiThermo.C at line 64.

FOAM exiting


hey!!
i was solving a two phase vof problem using hRhoThermo and encountered a similar error.... did you get past the error?? i am in a pinch as i cannot understand the error message!!
please help me out!!!
thanks!
regards,
Karthik

vkrastev March 17, 2011 17:26

Quote:

Originally Posted by juho (Post 280323)
In the 1.7.x version, the chtMultiRegionFoam and chtMultiRegionSimpleFoam have recently been modified to use hRhoThermo, which allows icoPolynomial equation of state and thus simulation of liquid flows.

Check Henry's commits 14.-15.10.2010:
http://github.com/OpenCFD/OpenFOAM-1.7.x/commits/master

Hello all, I've downloaded the add-ons and modifications from the link posted above and compiled them for OF 1.7.1: till now I've only made a simple test case with an aluminium pipe containing water (chtMultiRegionFoam), but all seem to work perfectly...

Regards

V.


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