N2.H 5.37 KB
Newer Older
1 2 3 4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2017 OpenFOAM Foundation
9 10 11 12
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

13 14 15 16
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
17 18 19 20 21 22 23

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
24
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

Class
    Foam::N2

Description
    Liquid N2

SourceFiles
    N2.C

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

#ifndef N2_H
#define N2_H

40
#include "liquidProperties.H"
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#include "NSRDSfunc0.H"
#include "NSRDSfunc1.H"
#include "NSRDSfunc2.H"
#include "NSRDSfunc3.H"
#include "NSRDSfunc4.H"
#include "NSRDSfunc5.H"
#include "NSRDSfunc6.H"
#include "NSRDSfunc7.H"
#include "NSRDSfunc14.H"
#include "APIdiffCoefFunc.H"

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
                           Class N2 Declaration
\*---------------------------------------------------------------------------*/

class N2
:
63
    public liquidProperties
64 65 66 67 68 69
{
    // Private data

        NSRDSfunc5 rho_;
        NSRDSfunc1 pv_;
        NSRDSfunc6 hl_;
Andrew Heather's avatar
Andrew Heather committed
70
        NSRDSfunc0 Cp_;
71
        NSRDSfunc0 h_;
Andrew Heather's avatar
Andrew Heather committed
72
        NSRDSfunc7 Cpg_;
73 74 75
        NSRDSfunc4 B_;
        NSRDSfunc1 mu_;
        NSRDSfunc2 mug_;
76 77
        NSRDSfunc0 kappa_;
        NSRDSfunc2 kappag_;
78 79 80 81 82 83
        NSRDSfunc6 sigma_;
        APIdiffCoefFunc D_;


public:

84 85
    friend class liquidProperties;

86 87 88 89 90 91 92
    //- Runtime type information
    TypeName("N2");


    // Constructors

        //- Construct null
Andrew Heather's avatar
Andrew Heather committed
93 94 95
        N2();

        //- Construct from components
96 97
        N2
        (
98
            const liquidProperties& l,
99 100 101 102 103 104 105 106 107 108 109 110 111
            const NSRDSfunc5& density,
            const NSRDSfunc1& vapourPressure,
            const NSRDSfunc6& heatOfVapourisation,
            const NSRDSfunc0& heatCapacity,
            const NSRDSfunc0& enthalpy,
            const NSRDSfunc7& idealGasHeatCapacity,
            const NSRDSfunc4& secondVirialCoeff,
            const NSRDSfunc1& dynamicViscosity,
            const NSRDSfunc2& vapourDynamicViscosity,
            const NSRDSfunc0& thermalConductivity,
            const NSRDSfunc2& vapourThermalConductivity,
            const NSRDSfunc6& surfaceTension,
            const APIdiffCoefFunc& vapourDiffussivity
Andrew Heather's avatar
Andrew Heather committed
112
        );
113

114 115 116
        //- Construct from dictionary
        N2(const dictionary& dict);

117
        //- Construct and return clone
118
        virtual autoPtr<liquidProperties> clone() const
119
        {
120
            return autoPtr<liquidProperties>::NewFrom<N2>(*this);
121 122
        }

123 124 125 126

    // Member Functions

        //- Liquid density [kg/m^3]
Andrew Heather's avatar
Andrew Heather committed
127
        inline scalar rho(scalar p, scalar T) const;
128 129

        //- Vapour pressure [Pa]
Andrew Heather's avatar
Andrew Heather committed
130
        inline scalar pv(scalar p, scalar T) const;
131 132

        //- Heat of vapourisation [J/kg]
Andrew Heather's avatar
Andrew Heather committed
133
        inline scalar hl(scalar p, scalar T) const;
134 135

        //- Liquid heat capacity [J/(kg K)]
Andrew Heather's avatar
Andrew Heather committed
136
        inline scalar Cp(scalar p, scalar T) const;
137 138

        //- Liquid Enthalpy [J/(kg)]
Andrew Heather's avatar
Andrew Heather committed
139
        inline scalar h(scalar p, scalar T) const;
140 141

        //- Ideal gas heat capacity [J/(kg K)]
Andrew Heather's avatar
Andrew Heather committed
142
        inline scalar Cpg(scalar p, scalar T) const;
143 144

        //- Second Virial Coefficient [m^3/kg]
Andrew Heather's avatar
Andrew Heather committed
145
        inline scalar B(scalar p, scalar T) const;
146 147

        //- Liquid viscosity [Pa s]
Andrew Heather's avatar
Andrew Heather committed
148
        inline scalar mu(scalar p, scalar T) const;
149 150

        //- Vapour viscosity [Pa s]
Andrew Heather's avatar
Andrew Heather committed
151
        inline scalar mug(scalar p, scalar T) const;
152

Andrew Heather's avatar
Andrew Heather committed
153
        //- Liquid thermal conductivity [W/(m K)]
154
        inline scalar kappa(scalar p, scalar T) const;
155

Andrew Heather's avatar
Andrew Heather committed
156
        //- Vapour thermal conductivity [W/(m K)]
157
        inline scalar kappag(scalar p, scalar T) const;
158 159

        //- Surface tension [N/m]
Andrew Heather's avatar
Andrew Heather committed
160
        inline scalar sigma(scalar p, scalar T) const;
161

Andrew Heather's avatar
Andrew Heather committed
162
        //- Vapour diffusivity [m2/s]
Andrew Heather's avatar
Andrew Heather committed
163
        inline scalar D(scalar p, scalar T) const;
164

Andrew Heather's avatar
Andrew Heather committed
165
        //- Vapour diffusivity [m2/s] with specified binary pair
166 167
        inline scalar D(scalar p, scalar T, scalar Wb) const;

168

Andrew Heather's avatar
Andrew Heather committed
169 170
    // I-O

171
        //- Write the function coefficients
172
        void writeData(Ostream& os) const;
173

Andrew Heather's avatar
Andrew Heather committed
174
        //- Ostream Operator
175
        friend Ostream& operator<<(Ostream& os, const N2& l);
176 177 178
};


179 180 181
Ostream& operator<<(Ostream& os, const N2& l);


182 183 184 185 186 187
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

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

Andrew Heather's avatar
Andrew Heather committed
188 189 190 191
#include "N2I.H"

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

192 193 194
#endif

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