functionObjects/utilities/scalarTransport: Set UName_ during construction for boundaryTypes()

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1972
This commit is contained in:
Henry Weller
2016-01-15 14:47:56 +00:00
parent 36fc8595db
commit fa191d3456
2 changed files with 102 additions and 119 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -149,10 +149,9 @@ Foam::scalarTransport::scalarTransport
: :
name_(name), name_(name),
mesh_(refCast<const fvMesh>(obr)), mesh_(refCast<const fvMesh>(obr)),
active_(true), phiName_(dict.lookupOrDefault<word>("phiName", "phi")),
phiName_("phi"), UName_(dict.lookupOrDefault<word>("UName", "U")),
UName_("U"), rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")),
rhoName_("rho"),
DT_(0.0), DT_(0.0),
userDT_(false), userDT_(false),
resetOnStartUp_(false), resetOnStartUp_(false),
@ -192,8 +191,6 @@ Foam::scalarTransport::~scalarTransport()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::scalarTransport::read(const dictionary& dict) void Foam::scalarTransport::read(const dictionary& dict)
{
if (active_)
{ {
Info<< type() << ":" << nl; Info<< type() << ":" << nl;
@ -215,12 +212,9 @@ void Foam::scalarTransport::read(const dictionary& dict)
fvOptions_.reset(dict.subDict("fvOptions")); fvOptions_.reset(dict.subDict("fvOptions"));
} }
}
void Foam::scalarTransport::execute() void Foam::scalarTransport::execute()
{
if (active_)
{ {
Info<< type() << " output:" << endl; Info<< type() << " output:" << endl;
@ -302,28 +296,20 @@ void Foam::scalarTransport::execute()
Info<< endl; Info<< endl;
} }
}
void Foam::scalarTransport::end() void Foam::scalarTransport::end()
{
if (active_)
{ {
execute(); execute();
} }
}
void Foam::scalarTransport::timeSet() void Foam::scalarTransport::timeSet()
{ {}
// Do nothing
}
void Foam::scalarTransport::write() void Foam::scalarTransport::write()
{ {}
// Do nothing
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,9 +78,6 @@ class scalarTransport
//- Reference to the mesh database //- Reference to the mesh database
const fvMesh& mesh_; const fvMesh& mesh_;
//- On/off switch
bool active_;
//- Name of flux field (optional) //- Name of flux field (optional)
word phiName_; word phiName_;