Skip to content
Snippets Groups Projects
Commit 12b68e11 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: replace finiteArea timeVaryingUniformFixedValue with Function1 version

- timeVaryingUniformFixedValue -> uniformFixedValue

- allows a variety of functions (eg, coded, expressions, tables, ...)

- more similarity to finiteVolume patch type

STYLE: remove unused timeVarying... from etc/controlDict
parent bb3660b9
Branches
Tags
No related merge requests found
......@@ -903,10 +903,7 @@ DebugSwitches
thermophysicalFunction 0;
time 0;
timeVaryingAlphaContactAngle 0;
timeVaryingFlowRateInletVelocity 0;
timeVaryingMappedFixedValue 0;
timeVaryingTotalPressure 0;
timeVaryingUniformFixedValue 0;
timer 0;
topoAction 0;
topoCellLooper 0;
......
......@@ -48,7 +48,7 @@ $(derivedFaPatchFields)/fixedValueOutflow/fixedValueOutflowFaPatchFields.C
$(derivedFaPatchFields)/inletOutlet/inletOutletFaPatchFields.C
$(derivedFaPatchFields)/slip/slipFaPatchFields.C
$(derivedFaPatchFields)/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.C
$(derivedFaPatchFields)/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.C
$(derivedFaPatchFields)/uniformFixedValue/uniformFixedValueFaPatchFields.C
faePatchFields = fields/faePatchFields
$(faePatchFields)/faePatchField/faePatchFields.C
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,27 +25,24 @@ License
\*---------------------------------------------------------------------------*/
#include "timeVaryingUniformFixedValueFaPatchField.H"
#include "Time.H"
#include "uniformFixedValueFaPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::timeVaryingUniformFixedValueFaPatchField<Type>::
timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
(
const faPatch& p,
const DimensionedField<Type, areaMesh>& iF
)
:
fixedValueFaPatchField<Type>(p, iF),
timeSeries_()
uniformValue_(nullptr)
{}
template<class Type>
Foam::timeVaryingUniformFixedValueFaPatchField<Type>::
timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
(
const faPatch& p,
const DimensionedField<Type, areaMesh>& iF,
......@@ -53,85 +50,83 @@ timeVaryingUniformFixedValueFaPatchField
)
:
fixedValueFaPatchField<Type>(p, iF),
timeSeries_(dict)
uniformValue_(Function1<Type>::New("uniformValue", dict))
{
if (dict.found("value"))
{
faPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
faPatchField<Type>::operator==
(
Field<Type>("value", dict, p.size())
);
}
else
{
updateCoeffs();
this->evaluate();
}
}
template<class Type>
Foam::timeVaryingUniformFixedValueFaPatchField<Type>::
timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>& ptf,
const uniformFixedValueFaPatchField<Type>& ptf,
const faPatch& p,
const DimensionedField<Type, areaMesh>& iF,
const faPatchFieldMapper& mapper
)
:
fixedValueFaPatchField<Type>(ptf, p, iF, mapper),
timeSeries_(ptf.timeSeries_)
uniformValue_(ptf.uniformValue_.clone())
{}
template<class Type>
Foam::timeVaryingUniformFixedValueFaPatchField<Type>::
timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>& ptf
const uniformFixedValueFaPatchField<Type>& ptf
)
:
fixedValueFaPatchField<Type>(ptf),
timeSeries_(ptf.timeSeries_)
uniformValue_(ptf.uniformValue_.clone())
{}
template<class Type>
Foam::timeVaryingUniformFixedValueFaPatchField<Type>::
timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>& ptf,
const uniformFixedValueFaPatchField<Type>& ptf,
const DimensionedField<Type, areaMesh>& iF
)
:
fixedValueFaPatchField<Type>(ptf, iF),
timeSeries_(ptf.timeSeries_)
uniformValue_(ptf.uniformValue_.clone())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::timeVaryingUniformFixedValueFaPatchField<Type>::updateCoeffs()
void Foam::uniformFixedValueFaPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
faPatchField<Type>::operator==
(
timeSeries_(this->db().time().timeOutputValue())
);
const scalar t = this->db().time().timeOutputValue();
faPatchField<Type>::operator==(uniformValue_->value(t));
fixedValueFaPatchField<Type>::updateCoeffs();
}
template<class Type>
void Foam::timeVaryingUniformFixedValueFaPatchField<Type>::write
void Foam::uniformFixedValueFaPatchField<Type>::write
(
Ostream& os
) const
{
faPatchField<Type>::write(os);
timeSeries_.write(os);
uniformValue_->writeData(os);
this->writeEntry("value", os);
}
......
......@@ -5,8 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,43 +24,42 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::timeVaryingUniformFixedValueFaPatchField
Foam::uniformFixedValueFaPatchField
Description
A time-varying form of a uniform fixed value finite area
boundary condition.
This finiteArea boundary condition
provides a uniform fixed value condition, which can also be time-varying.
Usage
\table
Property | Description | Required | Default
uniformValue | uniform value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
inlet
<patchName>
{
type timeVaryingUniformFixedValue;
fileName "<case>/time-series";
outOfBounds clamp; // (error|warn|clamp|repeat)
type uniformFixedValue;
uniformValue constant 0.2;
}
\endverbatim
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd.
Note
This class is derived directly from a fixedValue patch rather than from
a uniformFixedValue patch.
See Also
Foam::interpolationTable and Foam::fixedValueFaPatchField
See also
Foam::Function1Types
Foam::fixedValueFvPatchField
Foam::uniformFixedValueFvPatchField.C
SourceFiles
timeVaryingUniformFixedValueFaPatchField.C
uniformFixedValueFaPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef timeVaryingUniformFixedValueFaPatchField_H
#define timeVaryingUniformFixedValueFaPatchField_H
#ifndef uniformFixedValueFaPatchField_H
#define uniformFixedValueFaPatchField_H
#include "fixedValueFaPatchField.H"
#include "interpolationTable.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -69,56 +67,56 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class timeVaryingUniformFixedValueFaPatch Declaration
Class uniformFixedValueFaPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class timeVaryingUniformFixedValueFaPatchField
class uniformFixedValueFaPatchField
:
public fixedValueFaPatchField<Type>
{
// Private data
// Private Data
//- The time series being used, including the bounding treatment
interpolationTable<Type> timeSeries_;
//- Value
autoPtr<Function1<Type>> uniformValue_;
public:
//- Runtime type information
TypeName("timeVaryingUniformFixedValue");
TypeName("uniformFixedValue");
// Constructors
//- Construct from patch and internal field
timeVaryingUniformFixedValueFaPatchField
uniformFixedValueFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&
);
//- Construct from patch, internal field and dictionary
timeVaryingUniformFixedValueFaPatchField
uniformFixedValueFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const dictionary&
);
//- Construct by mapping given patch field onto a new patch
timeVaryingUniformFixedValueFaPatchField
//- Construct by mapping onto a new patch
uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>&,
const uniformFixedValueFaPatchField<Type>&,
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const faPatchFieldMapper&
);
//- Construct as copy
timeVaryingUniformFixedValueFaPatchField
//- Copy construct
uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>&
const uniformFixedValueFaPatchField<Type>&
);
//- Construct and return a clone
......@@ -126,14 +124,14 @@ public:
{
return tmp<faPatchField<Type>>
(
new timeVaryingUniformFixedValueFaPatchField<Type>(*this)
new uniformFixedValueFaPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
timeVaryingUniformFixedValueFaPatchField
uniformFixedValueFaPatchField
(
const timeVaryingUniformFixedValueFaPatchField<Type>&,
const uniformFixedValueFaPatchField<Type>&,
const DimensionedField<Type, areaMesh>&
);
......@@ -145,34 +143,22 @@ public:
{
return tmp<faPatchField<Type>>
(
new timeVaryingUniformFixedValueFaPatchField<Type>(*this, iF)
new uniformFixedValueFaPatchField<Type>(*this, iF)
);
}
//- Destructor
virtual ~timeVaryingUniformFixedValueFaPatchField() = default;
// Member functions
// Access
//- Return the time series used
const interpolationTable<Type>& timeSeries() const
{
return timeSeries_;
}
virtual ~uniformFixedValueFaPatchField() = default;
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
// Member Functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
virtual void write(Ostream& os) const;
};
......@@ -183,7 +169,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "timeVaryingUniformFixedValueFaPatchField.C"
#include "uniformFixedValueFaPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "timeVaryingUniformFixedValueFaPatchFields.H"
#include "uniformFixedValueFaPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "areaFields.H"
......@@ -36,7 +36,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFaPatchFields(timeVaryingUniformFixedValue);
makeFaPatchFields(uniformFixedValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,10 +25,10 @@ License
\*---------------------------------------------------------------------------*/
#ifndef timeVaryingUniformFixedValueFaPatchFields_H
#define timeVaryingUniformFixedValueFaPatchFields_H
#ifndef uniformFixedValueFaPatchFields_H
#define uniformFixedValueFaPatchFields_H
#include "timeVaryingUniformFixedValueFaPatchField.H"
#include "uniformFixedValueFaPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -38,7 +38,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue)
makeFaPatchTypeFieldTypedefs(uniformFixedValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,8 +25,8 @@ License
\*---------------------------------------------------------------------------*/
#ifndef timeVaryingUniformFixedValueFaPatchFieldsFwd_H
#define timeVaryingUniformFixedValueFaPatchFieldsFwd_H
#ifndef uniformFixedValueFaPatchFieldsFwd_H
#define uniformFixedValueFaPatchFieldsFwd_H
#include "faPatchField.H"
#include "fieldTypes.H"
......@@ -38,9 +38,9 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class timeVaryingUniformFixedValueFaPatchField;
template<class Type> class uniformFixedValueFaPatchField;
makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue);
makeFaPatchTypeFieldTypedefs(uniformFixedValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -23,8 +23,8 @@ boundaryField
{
inlet
{
type fixedValue;
value uniform 0.000141;
type uniformFixedValue;
uniformValue 0.000141;
}
outlet
......
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