ENH: use default zero (opaque) "transmissivity" in radiation lookup

- improves input compatibility with existing setups
This commit is contained in:
Mark Olesen
2019-10-01 08:54:15 +02:00
committed by Andrew Heather
parent 836d3a849f
commit f8539f8b46
3 changed files with 15 additions and 14 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) 2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -82,7 +82,7 @@ Foam::scalar Foam::radiation::lookup::e
const scalar T const scalar T
) const ) const
{ {
return(dict_.get<scalar>("emissivity")); return dict_.get<scalar>("emissivity");
} }
@ -110,7 +110,7 @@ Foam::scalar Foam::radiation::lookup::a
const scalar T const scalar T
) const ) const
{ {
return(dict_.get<scalar>("absorptivity")); return dict_.get<scalar>("absorptivity");
} }
@ -124,7 +124,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::lookup::t
return tmp<scalarField>::New return tmp<scalarField>::New
( (
pp_.size(), pp_.size(),
dict_.get<scalar>("transmissivity") dict_.getOrDefault<scalar>("transmissivity", 0)
); );
} }
@ -137,7 +137,7 @@ Foam::scalar Foam::radiation::lookup::t
const scalar T const scalar T
) const ) const
{ {
return(dict_.get<scalar>("transmissivity")); return dict_.getOrDefault<scalar>("transmissivity", 0);
} }

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) 2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::radiation::lookup Foam::radiation::lookup
Description Description
Look up type of boundary radiation properties. Lookup type of boundary radiation properties.
Usage Usage
\verbatim \verbatim
@ -35,6 +35,7 @@ Usage
type lookup; type lookup;
absorptivity 0.1; absorptivity 0.1;
emissivity 0.1; emissivity 0.1;
transmissivity 0;
} }
\endverbatim \endverbatim
@ -62,7 +63,6 @@ class lookup
: :
public boundaryRadiationPropertiesPatch public boundaryRadiationPropertiesPatch
{ {
protected: protected:
// Protected data // Protected data
@ -70,7 +70,7 @@ protected:
//- Reference to the polyPatch //- Reference to the polyPatch
const polyPatch& pp_; const polyPatch& pp_;
//-Dictionary //- Dictionary
const dictionary dict_; const dictionary dict_;
@ -88,6 +88,7 @@ public:
//- Destructor //- Destructor
virtual ~lookup() = default; virtual ~lookup() = default;
// Member Functions // Member Functions
//- Return emissivity //- Return emissivity
@ -124,7 +125,7 @@ public:
const scalar T const scalar T
) const; ) const;
//- Return transmissivity on patch //- Return transmissivity on patch (default: 0)
virtual tmp<scalarField> t virtual tmp<scalarField> t
( (
const label bandI, const label bandI,
@ -132,7 +133,7 @@ public:
scalarField* T scalarField* T
) const; ) const;
//- Return transmissivity on face //- Return transmissivity on face (default: 0)
virtual scalar t virtual scalar t
( (
const label faceI, const label faceI,
@ -162,7 +163,7 @@ public:
virtual tmp<scalarField> rDiff virtual tmp<scalarField> rDiff
( (
const label bandI, const label bandI,
vectorField* incomingDirection , vectorField* incomingDirection,
scalarField* T scalarField* T
) const; ) const;

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) 2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,7 +53,7 @@ Foam::radiation::opaqueReflective::opaqueReflective
: :
boundaryRadiationPropertiesPatch(dict, pp), boundaryRadiationPropertiesPatch(dict, pp),
pp_(pp), pp_(pp),
fd_(dict.lookupOrDefault<scalar>("fd", 1)) fd_(dict.getOrDefault<scalar>("fd", 1))
{ {
const dictionary& absorptionDict = const dictionary& absorptionDict =
dict.subDict("wallAbsorptionEmissionModel"); dict.subDict("wallAbsorptionEmissionModel");