constAnIsoSolidTransportI.H 3.39 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 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    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.

    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
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

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

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

30 31
template<class Thermo>
inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
32
(
33
    const Thermo& t,
34 35 36
    const vector kappa
)
:
37
    Thermo(t),
38 39 40 41
    kappa_(kappa)
{}


42 43
template<class Thermo>
inline Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
44 45 46 47 48
(
    const word& name,
    const constAnIsoSolidTransport& ct
)
:
49
    Thermo(name, ct),
50 51 52 53
    kappa_(ct.kappa_)
{}


54
template<class Thermo>
55
inline Foam::autoPtr<Foam::constAnIsoSolidTransport<Thermo>>
56 57 58 59 60
Foam::constAnIsoSolidTransport<Thermo>::New
(
    const dictionary& dict
)
{
61
    return autoPtr<constAnIsoSolidTransport<Thermo>>::New(dict);
62 63
}

64 65
// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

66 67 68
template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
kappa(const scalar p, const scalar T) const
69 70 71 72
{
    return mag(kappa_);
}

73 74 75
template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
Kappa(const scalar p, const scalar T) const
76 77 78 79
{
    return kappa_;
}

80 81 82 83 84

template<class Thermo>
inline Foam::scalar Foam::constAnIsoSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const
{
85
    NotImplemented;
86
    return 0;
87 88 89 90 91 92 93
}


template<class Thermo>
inline Foam::vector Foam::constAnIsoSolidTransport<Thermo>::
alphah(const scalar p, const scalar T) const
{
94
    return kappa_/this->Cp(p, T);
95 96
}

97 98
// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //

99 100
template<class Thermo>
inline void Foam::constAnIsoSolidTransport<Thermo>::operator+=
101
(
102
    const constAnIsoSolidTransport<Thermo>& ct
103 104
)
{
105
    scalar Y1 = this->Y();
106

107 108
    Y1 /= this->Y();
    scalar Y2 = ct.Y()/this->Y();
109

110
    kappa_ = Y1*kappa_ + Y2*ct.kappa_;
111 112 113 114 115 116
}


// * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //


117 118
template<class Thermo>
inline Foam::constAnIsoSolidTransport<Thermo> Foam::operator*
119 120
(
    const scalar s,
121
    const constAnIsoSolidTransport<Thermo>& ct
122 123
)
{
124
    return constAnIsoSolidTransport<Thermo>
125
    (
126
        s*static_cast<const Thermo&>(ct),
127 128 129 130 131
        ct.kappa_
    );
}

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