Skip to content
Snippets Groups Projects
Commit 3177e815 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: adjust thermalPorousZone to match documentation

eg, dictionary entry:

        thermalModel
        {
            type        none; // fixedTemperature;
            // fixedTemperature coefficients
            T           350;
        }

A missing thermalModel is treated as 'none'
parent 5c3c1b2d
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 35 deletions
...@@ -2,7 +2,7 @@ ...@@ -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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -445,6 +445,13 @@ void Foam::porousZone::writeDict(Ostream& os, bool subDict) const ...@@ -445,6 +445,13 @@ void Foam::porousZone::writeDict(Ostream& os, bool subDict) const
dictPtr->write(os); dictPtr->write(os);
} }
// thermalModel
if (const dictionary* dictPtr = dict_.subDictPtr("thermalModel"))
{
os << indent << "thermalModel";
dictPtr->write(os);
}
os << decrIndent << indent << token::END_BLOCK << endl; os << decrIndent << indent << token::END_BLOCK << endl;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -51,8 +51,8 @@ namespace porousMedia ...@@ -51,8 +51,8 @@ namespace porousMedia
Foam::porousMedia::fixedTemperature::fixedTemperature(const porousZone& pZone) Foam::porousMedia::fixedTemperature::fixedTemperature(const porousZone& pZone)
: :
thermalModel(pZone, typeName), thermalModel(pZone),
T_(readScalar(coeffDict_.lookup("T"))) T_(readScalar(thermalCoeffs_.lookup("T")))
{} {}
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -33,7 +33,6 @@ Description ...@@ -33,7 +33,6 @@ Description
#define fixedTemperature_H #define fixedTemperature_H
#include "thermalModel.H" #include "thermalModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -81,7 +80,7 @@ public: ...@@ -81,7 +80,7 @@ public:
//- Add the thermal source to the enthalpy equation //- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource virtual void addEnthalpySource
( (
const basicThermo& thermo, const basicThermo&,
const volScalarField& rho, const volScalarField& rho,
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const; ) const;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -33,7 +33,6 @@ Description ...@@ -33,7 +33,6 @@ Description
#define noThermalModel_H #define noThermalModel_H
#include "thermalModel.H" #include "thermalModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -73,7 +72,7 @@ public: ...@@ -73,7 +72,7 @@ public:
//- Add the thermal source to the enthalpy equation //- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource virtual void addEnthalpySource
( (
const basicThermo& thermo, const basicThermo&,
const volScalarField& rho, const volScalarField& rho,
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const; ) const;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -42,18 +42,18 @@ namespace porousMedia ...@@ -42,18 +42,18 @@ namespace porousMedia
Foam::porousMedia::thermalModel::thermalModel(const porousZone& pZone) Foam::porousMedia::thermalModel::thermalModel(const porousZone& pZone)
: :
pZone_(pZone), pZone_(pZone),
coeffDict_(dictionary::null) thermalCoeffs_(pZone.dict().subDictPtr("thermalModel"))
{} {}
Foam::porousMedia::thermalModel::thermalModel Foam::porousMedia::thermalModel::thermalModel
( (
const porousZone& pZone, const porousZone& pZone,
const word& modelType const dictionary& thermalCoeffs
) )
: :
pZone_(pZone), pZone_(pZone),
coeffDict_(pZone_.dict().subDict(modelType + "Coeffs")) thermalCoeffs_(thermalCoeffs)
{} {}
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -63,8 +63,8 @@ protected: ...@@ -63,8 +63,8 @@ protected:
//- Reference to the porous zone //- Reference to the porous zone
const porousZone& pZone_; const porousZone& pZone_;
//- Sub-model coefficients dictionary //- Thermal model coefficients dictionary
const dictionary coeffDict_; const dictionary thermalCoeffs_;
public: public:
...@@ -87,11 +87,11 @@ public: ...@@ -87,11 +87,11 @@ public:
// Constructors // Constructors
//- Construct null from porous zone //- Construct from porous zone, coefficients from "thermalModel" entry
thermalModel(const porousZone&); thermalModel(const porousZone&);
//- Construct from porous zone and model type name //- Construct from porous zone and thermal model coefficients
thermalModel(const porousZone&, const word& modelType); thermalModel(const porousZone&, const dictionary& thermalCoeffs);
//- Destructor //- Destructor
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
//- Add the thermal source to the enthalpy equation //- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource virtual void addEnthalpySource
( (
const basicThermo& thermo, const basicThermo&,
const volScalarField& rho, const volScalarField& rho,
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const = 0; ) const = 0;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -33,7 +33,13 @@ Foam::porousMedia::thermalModel::New ...@@ -33,7 +33,13 @@ Foam::porousMedia::thermalModel::New
const porousZone& pZone const porousZone& pZone
) )
{ {
const word modelType(pZone.dict().lookup("thermalModel")); // a missing thermalModel is the same as type "none"
word modelType("none");
if (const dictionary* dictPtr = pZone.dict().subDictPtr("thermalModel"))
{
dictPtr->lookup("type") >> modelType;
}
Info<< "Selecting thermalModel " << modelType << endl; Info<< "Selecting thermalModel " << modelType << endl;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -51,7 +51,10 @@ void Foam::thermalPorousZone::addEnthalpySource ...@@ -51,7 +51,10 @@ void Foam::thermalPorousZone::addEnthalpySource
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const ) const
{ {
model_->addEnthalpySource(thermo, rho, hEqn); if (model_.valid())
{
model_->addEnthalpySource(thermo, rho, hEqn);
}
} }
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
//- Add the thermal source to the enthalpy equation //- Add the thermal source to the enthalpy equation
void addEnthalpySource void addEnthalpySource
( (
const basicThermo& thermo, const basicThermo&,
const volScalarField& rho, const volScalarField& rho,
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const; ) const;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -32,7 +32,8 @@ Description ...@@ -32,7 +32,8 @@ Description
thermalPorousZone. thermalPorousZone.
The input file \c constant/thermalPorousZone is implemented as The input file \c constant/thermalPorousZone is implemented as
IOPtrList\<thermalPorousZone\> and contains the following type of data: IOPtrList\<thermalPorousZone\> (but written as a dictionary)
and contains the following type of data:
\verbatim \verbatim
1 1
...@@ -94,7 +95,7 @@ public: ...@@ -94,7 +95,7 @@ public:
//- Add the thermal source to the enthalpy equation //- Add the thermal source to the enthalpy equation
void addEnthalpySource void addEnthalpySource
( (
const basicThermo& thermo, const basicThermo&,
const volScalarField& rho, const volScalarField& rho,
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const; ) const;
......
...@@ -31,11 +31,12 @@ FoamFile ...@@ -31,11 +31,12 @@ FoamFile
f f [0 -1 0 0 0 0 0] (0 0 0); f f [0 -1 0 0 0 0 0] (0 0 0);
} }
thermalModel none; // fixedTemperature; thermalModel
fixedTemperatureCoeffs
{ {
T 350; type none; // fixedTemperature;
// fixedTemperature coefficients
T 350;
} }
} }
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment