Skip to content
Snippets Groups Projects
Commit 9d044ac1 authored by Henry's avatar Henry
Browse files

solidThermo: Updated selection mechanism

parent 865f2448
Branches
Tags
No related merge requests found
solidThermo/solidThermo.C
solidThermo/solidThermoNew.C
solidThermo/solidThermos.C
mixtures/basicSolidMixture/basicSolidMixture.C
solidReactionThermo/solidReactionThermo.C
solidReactionThermo/solidReactionThermoNew.C
solidReactionThermo/solidReactionThermos.C
LIB = $(FOAM_LIBBIN)/libsolidThermo
......@@ -54,6 +54,27 @@ Foam::solidReactionThermo::solidReactionThermo
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
(
const fvMesh& mesh
)
{
return basicThermo::New<solidReactionThermo>(mesh);
}
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
(
const fvMesh& mesh,
const dictionary& dict
)
{
return basicThermo::New<solidReactionThermo>(mesh, dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::solidReactionThermo::~solidReactionThermo()
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
\*---------------------------------------------------------------------------*/
#include "solidReactionThermo.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
(
const fvMesh& mesh
)
{
// get model name, but do not register the dictionary
// otherwise it is registered in the database twice
const word modelType
(
IOdictionary
(
IOobject
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("thermoType")
);
Info<< "Selecting thermodynamics package " << modelType << endl;
fvMeshConstructorTable::iterator cstrIter =
fvMeshConstructorTablePtr_->find(modelType);
if (cstrIter == fvMeshConstructorTablePtr_->end())
{
FatalErrorIn("solidReactionThermo::New(const fvMesh&)")
<< "Unknown solidReactionThermo type "
<< modelType << nl << nl
<< "Valid solidReactionThermo types:" << nl
<< fvMeshConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
}
return autoPtr<solidReactionThermo>(cstrIter()(mesh));
}
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
(
const fvMesh& mesh,
const dictionary& dict
)
{
if (debug)
{
Info<< "solidReactionThermo::New(const fvMesh&, const dictionary&): "
<< "constructing solidReactionThermo"
<< endl;
}
const word thermoType = dict.lookup("thermoType");
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(thermoType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"solidReactionThermo::New(const fvMesh&, const dictionary&)"
) << "Unknown solidReactionThermo type " << thermoType
<< endl << endl
<< "Valid solidReactionThermo types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<solidReactionThermo>(cstrIter()(mesh, dict));
}
// ************************************************************************* //
......@@ -81,6 +81,27 @@ Foam::solidThermo::solidThermo
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
(
const fvMesh& mesh
)
{
return basicThermo::New<solidThermo>(mesh);
}
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
(
const fvMesh& mesh,
const dictionary& dict
)
{
return basicThermo::New<solidThermo>(mesh, dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::solidThermo::~solidThermo()
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
\*---------------------------------------------------------------------------*/
#include "solidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
(
const fvMesh& mesh
)
{
return basicThermo::New<solidThermo>(mesh);
}
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
(
const fvMesh& mesh,
const dictionary& dict
)
{
return basicThermo::New<solidThermo>(mesh, dict);
}
/*
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
(
const fvMesh& mesh,
const dictionary& dict
)
{
if (debug)
{
Info<< "solidThermo::New(const fvMesh&, const dictionary&): "
<< "constructing solidThermo"
<< endl;
}
const word thermoType = dict.lookup("thermoType");
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(thermoType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"solidThermo::New(const fvMesh&, const dictionary&)"
) << "Unknown solidThermo type " << thermoType
<< endl << endl
<< "Valid solidThermo types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<solidThermo>(cstrIter()(mesh, dict));
}
*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment