mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: radiation - temperature dependent absorption, emissivity, transmissivity
- constantAbsorption - updated a_ and e_ (Function1) - constantTransmissivity - updated tau_ (Function1)
This commit is contained in:
committed by
Mark OLESEN
parent
274fee92dd
commit
de39878b9b
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015-2018 OpenCFD Ltd.
|
Copyright (C) 2015-2018, 2024 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -56,8 +56,8 @@ Foam::radiation::constantAbsorption::constantAbsorption
|
|||||||
:
|
:
|
||||||
wallAbsorptionEmissionModel(dict, pp),
|
wallAbsorptionEmissionModel(dict, pp),
|
||||||
coeffsDict_(dict),
|
coeffsDict_(dict),
|
||||||
a_(coeffsDict_.get<scalar>("absorptivity")),
|
a_(Function1<scalar>::New("absorptivity", coeffsDict_)),
|
||||||
e_(coeffsDict_.get<scalar>("emissivity"))
|
e_(Function1<scalar>::New("emissivity", coeffsDict_))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +70,23 @@ Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::a
|
|||||||
const scalarField* T
|
const scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>::New(pp_.size(), a_);
|
if (a_->constant())
|
||||||
|
{
|
||||||
|
// Use arbitrary argument for a_
|
||||||
|
return tmp<scalarField>::New(pp_.size(), a_->value(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (T)
|
||||||
|
{
|
||||||
|
return a_->value(*T);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Attempted to set 'a' using a non-uniform function of Temperature, "
|
||||||
|
<< "but temperature field is unavailable"
|
||||||
|
<< abort(FatalError);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +98,7 @@ Foam::scalar Foam::radiation::constantAbsorption::a
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return a_;
|
return a_->value(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +109,23 @@ Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::e
|
|||||||
const scalarField* T
|
const scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>::New(pp_.size(), e_);
|
if (e_->constant())
|
||||||
|
{
|
||||||
|
// Use arbitrary argument for e_
|
||||||
|
return tmp<scalarField>::New(pp_.size(), e_->value(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (T)
|
||||||
|
{
|
||||||
|
return e_->value(*T);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Attempted to set 'e' using a non-uniform function of Temperature, "
|
||||||
|
<< "but temperature field is unavailable"
|
||||||
|
<< abort(FatalError);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +137,7 @@ Foam::scalar Foam::radiation::constantAbsorption::e
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return e_;
|
return e_->value(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018, 2024 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -41,6 +41,7 @@ SourceFiles
|
|||||||
#define Foam_radiation_constantAbsorption_H
|
#define Foam_radiation_constantAbsorption_H
|
||||||
|
|
||||||
#include "wallAbsorptionEmissionModel.H"
|
#include "wallAbsorptionEmissionModel.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,10 +65,10 @@ class constantAbsorption
|
|||||||
dictionary coeffsDict_;
|
dictionary coeffsDict_;
|
||||||
|
|
||||||
//- Absorptivity coefficient
|
//- Absorptivity coefficient
|
||||||
scalar a_;
|
autoPtr<Function1<scalar>> a_;
|
||||||
|
|
||||||
//- Emissivity coefficient
|
//- Emissivity coefficient
|
||||||
scalar e_;
|
autoPtr<Function1<scalar>> e_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015-2018 OpenCFD Ltd.
|
Copyright (C) 2015-2018, 2024 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -56,21 +56,36 @@ Foam::radiation::constantTransmissivity::constantTransmissivity
|
|||||||
:
|
:
|
||||||
wallTransmissivityModel(dict, pp),
|
wallTransmissivityModel(dict, pp),
|
||||||
coeffsDict_(dict),
|
coeffsDict_(dict),
|
||||||
tau_(coeffsDict_.get<scalar>("transmissivity"))
|
tau_(Function1<scalar>::New("transmissivity", coeffsDict_))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
Foam::tmp<Foam::scalarField> Foam::radiation::constantTransmissivity::t
|
||||||
Foam::radiation::constantTransmissivity::t
|
|
||||||
(
|
(
|
||||||
const label bandI,
|
const label bandI,
|
||||||
const vectorField* incomingDirection,
|
const vectorField* incomingDirection,
|
||||||
const scalarField* T
|
const scalarField* T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>::New(pp_.size(), tau_);
|
if (tau_->constant())
|
||||||
|
{
|
||||||
|
// Use arbitrary argument for a_
|
||||||
|
return tmp<scalarField>::New(pp_.size(), tau_->value(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (T)
|
||||||
|
{
|
||||||
|
return tau_->value(*T);
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Attempted to set 't' using a non-uniform function of Temperature, "
|
||||||
|
<< "but temperature field is unavailable"
|
||||||
|
<< abort(FatalError);
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +97,7 @@ Foam::scalar Foam::radiation::constantTransmissivity::t
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tau_;
|
return tau_->value(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015-2018 OpenCFD Ltd.
|
Copyright (C) 2015-2018, 2024 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -41,6 +41,7 @@ SourceFiles
|
|||||||
#define Foam_radiation_constantTransmissivity_H
|
#define Foam_radiation_constantTransmissivity_H
|
||||||
|
|
||||||
#include "wallTransmissivityModel.H"
|
#include "wallTransmissivityModel.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,7 +65,7 @@ class constantTransmissivity
|
|||||||
dictionary coeffsDict_;
|
dictionary coeffsDict_;
|
||||||
|
|
||||||
//- Transmissivity coefficient
|
//- Transmissivity coefficient
|
||||||
scalar tau_;
|
autoPtr<Function1<scalar>> tau_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user