phaseChangeTwoPhaseMixtureNew.C 2.43 KB
Newer Older
henry's avatar
henry committed
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
henry's avatar
henry committed
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2015 OpenFOAM Foundation
9
    Copyright (C) 2019 OpenCFD Ltd.
henry's avatar
henry committed
10 11 12 13
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

14 15 16 17
    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.
henry's avatar
henry committed
18 19 20 21 22 23 24

    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
25
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
henry's avatar
henry committed
26 27 28 29

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

#include "phaseChangeTwoPhaseMixture.H"
30
#include "incompressibleTwoPhaseMixture.H"
henry's avatar
henry committed
31 32 33 34 35 36 37

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

Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>
Foam::phaseChangeTwoPhaseMixture::New
(
    const volVectorField& U,
38
    const surfaceScalarField& phi
henry's avatar
henry committed
39 40
)
{
41
    const IOdictionary dict
42
    (
43
        IOobject
44
        (
45 46 47 48 49 50 51
            "transportProperties",
            U.time().constant(),
            U.db(),
            IOobject::MUST_READ,
            IOobject::NO_WRITE,
            false // Do not register
        )
52 53
    );

54 55
    const word modelType(dict.get<word>("phaseChangeTwoPhaseMixture"));

56
    Info<< "Selecting phaseChange model " << modelType << endl;
henry's avatar
henry committed
57

58
    auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
henry's avatar
henry committed
59

60
    if (!cstrIter.found())
henry's avatar
henry committed
61
    {
62
        FatalIOErrorInLookup
63
        (
64
            dict,
65 66 67
            "phaseChangeTwoPhaseMixture",
            modelType,
            *componentsConstructorTablePtr_
68
        ) << exit(FatalIOError);
henry's avatar
henry committed
69 70
    }

71
    return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
henry's avatar
henry committed
72 73 74 75
}


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