Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -967,7 +967,6 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
|
|||||||
|
|
||||||
bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
||||||
{
|
{
|
||||||
label nextPatchStart = mesh().nInternalFaces();
|
|
||||||
const polyBoundaryMesh& bm = *this;
|
const polyBoundaryMesh& bm = *this;
|
||||||
|
|
||||||
bool hasError = false;
|
bool hasError = false;
|
||||||
@ -976,20 +975,6 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
|||||||
|
|
||||||
forAll(bm, patchi)
|
forAll(bm, patchi)
|
||||||
{
|
{
|
||||||
if (bm[patchi].start() != nextPatchStart && !hasError)
|
|
||||||
{
|
|
||||||
hasError = true;
|
|
||||||
|
|
||||||
Info<< " ****Problem with boundary patch " << patchi
|
|
||||||
<< " named " << bm[patchi].name()
|
|
||||||
<< " of type " << bm[patchi].type()
|
|
||||||
<< ". The patch should start on face no " << nextPatchStart
|
|
||||||
<< " and the patch specifies " << bm[patchi].start()
|
|
||||||
<< "." << endl
|
|
||||||
<< "Possibly consecutive patches have this same problem."
|
|
||||||
<< " Suppressing future warnings." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!patchNames.insert(bm[patchi].name()) && !hasError)
|
if (!patchNames.insert(bm[patchi].name()) && !hasError)
|
||||||
{
|
{
|
||||||
hasError = true;
|
hasError = true;
|
||||||
@ -1000,8 +985,6 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
|
|||||||
<< "." << endl
|
<< "." << endl
|
||||||
<< "Suppressing future warnings." << endl;
|
<< "Suppressing future warnings." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
nextPatchStart += bm[patchi].size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(hasError, orOp<bool>());
|
reduce(hasError, orOp<bool>());
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -113,14 +113,22 @@ inline void lookupUnitsIfPresent
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::Function1s::Dimensioned<Type>::read
|
Foam::Function1s::Dimensioned<Type>::Dimensioned
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
|
const dimensionSet& xDimensions,
|
||||||
|
const dimensionSet& dimensions,
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
|
:
|
||||||
|
FieldFunction1<Type, Dimensioned<Type>>(name),
|
||||||
|
xUnits_(word::null, xDimensions, scalar(1)),
|
||||||
|
units_(word::null, dimensions, scalar(1)),
|
||||||
|
value_(nullptr)
|
||||||
{
|
{
|
||||||
// If the function is a dictionary (preferred) then read straightforwardly
|
// If the function is a dictionary (preferred) then read straightforwardly
|
||||||
if (dict.isDict(name))
|
if (dict.isDict(name))
|
||||||
@ -191,26 +199,6 @@ void Foam::Function1s::Dimensioned<Type>::read
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::Function1s::Dimensioned<Type>::Dimensioned
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const dimensionSet& xDimensions,
|
|
||||||
const dimensionSet& dimensions,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
FieldFunction1<Type, Dimensioned<Type>>(name),
|
|
||||||
xUnits_(word::null, xDimensions, scalar(1)),
|
|
||||||
units_(word::null, dimensions, scalar(1)),
|
|
||||||
value_(nullptr)
|
|
||||||
{
|
|
||||||
read(name, dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::Function1s::Dimensioned<Type>::Dimensioned(const Dimensioned<Type>& df1)
|
Foam::Function1s::Dimensioned<Type>::Dimensioned(const Dimensioned<Type>& df1)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -100,14 +100,6 @@ class Dimensioned
|
|||||||
autoPtr<Function1<Type>> value_;
|
autoPtr<Function1<Type>> value_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary. Note that this is
|
|
||||||
// the outer dictionary, not the coefficients dictionary, as is the
|
|
||||||
// case for most/all other Function1-s.
|
|
||||||
void read(const word& name, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Runtime type information
|
// Runtime type information
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,7 +53,7 @@ class None
|
|||||||
// Private member data
|
// Private member data
|
||||||
|
|
||||||
//- Name of dictionary from which this function is instantiated
|
//- Name of dictionary from which this function is instantiated
|
||||||
fileName dictName_;
|
const fileName dictName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,7 +68,7 @@ class Polynomial
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Polynomial coefficients - list of prefactor, exponent
|
//- Polynomial coefficients - list of prefactor, exponent
|
||||||
List<Tuple2<Type, Type>> coeffs_;
|
const List<Tuple2<Type, Type>> coeffs_;
|
||||||
|
|
||||||
//- Flag to indicate whether the function can be integrated
|
//- Flag to indicate whether the function can be integrated
|
||||||
bool integrable_;
|
bool integrable_;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,14 +27,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Function1Type>
|
|
||||||
void Foam::Function1s::Ramp<Function1Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
start_ = dict.lookupOrDefault<scalar>("start", 0);
|
|
||||||
duration_ = dict.lookup<scalar>("duration");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Function1Type>
|
template<class Function1Type>
|
||||||
Foam::Function1s::Ramp<Function1Type>::Ramp
|
Foam::Function1s::Ramp<Function1Type>::Ramp
|
||||||
(
|
(
|
||||||
@ -42,10 +34,10 @@ Foam::Function1s::Ramp<Function1Type>::Ramp
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<scalar, Function1Type>(name)
|
FieldFunction1<scalar, Function1Type>(name),
|
||||||
{
|
start_(dict.lookupOrDefault<scalar>("start", 0)),
|
||||||
read(dict);
|
duration_(dict.lookup<scalar>("duration"))
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -108,10 +108,10 @@ protected:
|
|||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Start-time of the ramp function
|
//- Start-time of the ramp function
|
||||||
scalar start_;
|
const scalar start_;
|
||||||
|
|
||||||
//- Duration of the ramp function
|
//- Duration of the ramp function
|
||||||
scalar duration_;
|
const scalar duration_;
|
||||||
|
|
||||||
//- Return the end-time of the ramp function
|
//- Return the end-time of the ramp function
|
||||||
inline scalar end() const
|
inline scalar end() const
|
||||||
@ -134,14 +134,6 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,23 +25,6 @@ License
|
|||||||
|
|
||||||
#include "Scale.H"
|
#include "Scale.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::Function1s::Scale<Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
scale_ = Function1<scalar>::New("scale", dict);
|
|
||||||
xScale_ =
|
|
||||||
dict.found("xScale")
|
|
||||||
? Function1<scalar>::New("xScale", dict)
|
|
||||||
: autoPtr<Function1<scalar>>(new Constant<scalar>("xScale", 1));
|
|
||||||
value_ = Function1<Type>::New("value", dict);
|
|
||||||
|
|
||||||
integrableScale_ = xScale_->constant() && scale_->constant();
|
|
||||||
integrableValue_ = xScale_->constant() && value_->constant();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -69,10 +52,18 @@ Foam::Function1s::Scale<Type>::Scale
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<Type, Scale<Type>>(name)
|
FieldFunction1<Type, Scale<Type>>(name),
|
||||||
{
|
scale_(Function1<scalar>::New("scale", dict)),
|
||||||
read(dict);
|
xScale_
|
||||||
}
|
(
|
||||||
|
dict.found("xScale")
|
||||||
|
? Function1<scalar>::New("xScale", dict)
|
||||||
|
: autoPtr<Function1<scalar>>(new Constant<scalar>("xScale", 1))
|
||||||
|
),
|
||||||
|
value_(Function1<Type>::New("value", dict)),
|
||||||
|
integrableScale_(xScale_->constant() && scale_->constant()),
|
||||||
|
integrableValue_(xScale_->constant() && value_->constant())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -141,25 +141,19 @@ class Scale
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Scalar scaling function
|
//- Scalar scaling function
|
||||||
autoPtr<Function1<scalar>> scale_;
|
const autoPtr<Function1<scalar>> scale_;
|
||||||
|
|
||||||
//- Argument scaling function
|
//- Argument scaling function
|
||||||
autoPtr<Function1<scalar>> xScale_;
|
const autoPtr<Function1<scalar>> xScale_;
|
||||||
|
|
||||||
//- Value function
|
//- Value function
|
||||||
autoPtr<Function1<Type>> value_;
|
const autoPtr<Function1<Type>> value_;
|
||||||
|
|
||||||
//- Is this function integrable?
|
//- Is this function integrable?
|
||||||
bool integrableScale_;
|
const bool integrableScale_;
|
||||||
|
|
||||||
//- Is this function integrable?
|
//- Is this function integrable?
|
||||||
bool integrableValue_;
|
const bool integrableValue_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,20 +25,6 @@ License
|
|||||||
|
|
||||||
#include "Sine.H"
|
#include "Sine.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::Function1s::Sine<Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
amplitude_ = Function1<Type>::New("amplitude", dict);
|
|
||||||
frequency_ = dict.lookup<scalar>("frequency");
|
|
||||||
start_ = dict.lookupOrDefault<scalar>("start", 0);
|
|
||||||
level_ = Function1<Type>::New("level", dict);
|
|
||||||
|
|
||||||
integrable_ = amplitude_->constant() && level_->constant();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -48,10 +34,13 @@ Foam::Function1s::Sine<Type>::Sine
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<Type, Sine<Type>>(name)
|
FieldFunction1<Type, Sine<Type>>(name),
|
||||||
{
|
amplitude_(Function1<Type>::New("amplitude", dict)),
|
||||||
read(dict);
|
frequency_(dict.lookup<scalar>("frequency")),
|
||||||
}
|
start_(dict.lookupOrDefault<scalar>("start", 0)),
|
||||||
|
level_(Function1<Type>::New("level", dict)),
|
||||||
|
integrable_(amplitude_->constant() && level_->constant())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -94,25 +94,19 @@ class Sine
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Amplitude of the sine function
|
//- Amplitude of the sine function
|
||||||
autoPtr<Function1<Type>> amplitude_;
|
const autoPtr<Function1<Type>> amplitude_;
|
||||||
|
|
||||||
//- Frequency of the sine function
|
//- Frequency of the sine function
|
||||||
scalar frequency_;
|
const scalar frequency_;
|
||||||
|
|
||||||
//- Argument offset
|
//- Argument offset
|
||||||
scalar start_;
|
const scalar start_;
|
||||||
|
|
||||||
//- Level to which the sine function is added
|
//- Level to which the sine function is added
|
||||||
autoPtr<Function1<Type>> level_;
|
const autoPtr<Function1<Type>> level_;
|
||||||
|
|
||||||
//- Is this function integrable?
|
//- Is this function integrable?
|
||||||
bool integrable_;
|
const bool integrable_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,21 +25,6 @@ License
|
|||||||
|
|
||||||
#include "Square.H"
|
#include "Square.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::Function1s::Square<Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
amplitude_ = Function1<Type>::New("amplitude", dict);
|
|
||||||
frequency_ = dict.lookup<scalar>("frequency");
|
|
||||||
start_ = dict.lookupOrDefault<scalar>("start", 0);
|
|
||||||
level_ = Function1<Type>::New("level", dict);
|
|
||||||
markSpace_ = dict.lookupOrDefault<scalar>("markSpace", 1);
|
|
||||||
|
|
||||||
integrable_ = amplitude_->constant() && level_->constant();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -49,10 +34,14 @@ Foam::Function1s::Square<Type>::Square
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<Type, Square<Type>>(name)
|
FieldFunction1<Type, Square<Type>>(name),
|
||||||
{
|
amplitude_(Function1<Type>::New("amplitude", dict)),
|
||||||
read(dict);
|
frequency_(dict.lookup<scalar>("frequency")),
|
||||||
}
|
start_(dict.lookupOrDefault<scalar>("start", 0)),
|
||||||
|
level_(Function1<Type>::New("level", dict)),
|
||||||
|
markSpace_(dict.lookupOrDefault<scalar>("markSpace", 1)),
|
||||||
|
integrable_(amplitude_->constant() && level_->constant())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -100,30 +100,24 @@ class Square
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Scalar amplitude of the square function
|
//- Scalar amplitude of the square function
|
||||||
autoPtr<Function1<Type>> amplitude_;
|
const autoPtr<Function1<Type>> amplitude_;
|
||||||
|
|
||||||
//- Frequency of the square function
|
//- Frequency of the square function
|
||||||
scalar frequency_;
|
const scalar frequency_;
|
||||||
|
|
||||||
//- Argument offset
|
//- Argument offset
|
||||||
scalar start_;
|
const scalar start_;
|
||||||
|
|
||||||
//- Level to which the square function is added
|
//- Level to which the square function is added
|
||||||
autoPtr<Function1<Type>> level_;
|
const autoPtr<Function1<Type>> level_;
|
||||||
|
|
||||||
//- Mark/space ratio of the square function; the fraction of one period
|
//- Mark/space ratio of the square function; the fraction of one period
|
||||||
// in which the function value is at the higher of the two possible
|
// in which the function value is at the higher of the two possible
|
||||||
// values.
|
// values.
|
||||||
scalar markSpace_;
|
const scalar markSpace_;
|
||||||
|
|
||||||
//- Is this function integrable?
|
//- Is this function integrable?
|
||||||
bool integrable_;
|
const bool integrable_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,13 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Function1s::omega::omega()
|
|
||||||
:
|
|
||||||
rpm_(false),
|
|
||||||
omegaFactor_(1)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Function1s::omega::omega(const dictionary& dict)
|
Foam::Function1s::omega::omega(const dictionary& dict)
|
||||||
:
|
:
|
||||||
rpm_(dict.found("rpm")),
|
rpm_(dict.found("rpm")),
|
||||||
@ -58,22 +51,6 @@ Foam::Function1s::omega::omega(const omega& o)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::Function1s::omega::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
rpm_ = dict.found("rpm");
|
|
||||||
omegaFactor_ = rpm_ ? constant::mathematical::pi/30.0 : 1;
|
|
||||||
|
|
||||||
omega_.reset
|
|
||||||
(
|
|
||||||
rpm_
|
|
||||||
? Function1<scalar>::New("rpm", dict).ptr()
|
|
||||||
: Function1<scalar>::New("omega", dict).ptr()
|
|
||||||
);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Function1s::omega::write(Ostream& os) const
|
void Foam::Function1s::omega::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
writeEntry(os, omega_());
|
writeEntry(os, omega_());
|
||||||
|
|||||||
@ -110,22 +110,19 @@ class omega
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- True if the input specification is rpm rather than omega
|
//- True if the input specification is rpm rather than omega
|
||||||
bool rpm_;
|
const bool rpm_;
|
||||||
|
|
||||||
//- 1 for omega, pi/30 for rpm
|
//- 1 for omega, pi/30 for rpm
|
||||||
scalar omegaFactor_;
|
const scalar omegaFactor_;
|
||||||
|
|
||||||
//- The omega function
|
//- The omega function
|
||||||
autoPtr<Function1<scalar>> omega_;
|
const autoPtr<Function1<scalar>> omega_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
omega();
|
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
omega(const dictionary& dict);
|
omega(const dictionary& dict);
|
||||||
|
|
||||||
@ -135,9 +132,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Update omega function from given dictionary
|
|
||||||
bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Return value for time t
|
//- Return value for time t
|
||||||
inline scalar value(const scalar t) const;
|
inline scalar value(const scalar t) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,23 +38,16 @@ namespace Function1s
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::Function1s::squarePulse::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
start_ = dict.lookupOrDefault<scalar>("start", 0);
|
|
||||||
duration_ = dict.lookup<scalar>("duration");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Function1s::squarePulse::squarePulse
|
Foam::Function1s::squarePulse::squarePulse
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<scalar, squarePulse>(name)
|
FieldFunction1<scalar, squarePulse>(name),
|
||||||
{
|
start_(dict.lookupOrDefault<scalar>("start", 0)),
|
||||||
read(dict);
|
duration_(dict.lookup<scalar>("duration"))
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -86,15 +86,10 @@ class squarePulse
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Start-time of the ramp function
|
//- Start-time of the ramp function
|
||||||
scalar start_;
|
const scalar start_;
|
||||||
|
|
||||||
//- Duration of the ramp function
|
//- Duration of the ramp function
|
||||||
scalar duration_;
|
const scalar duration_;
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,7 +53,7 @@ class None
|
|||||||
// Private member data
|
// Private member data
|
||||||
|
|
||||||
//- Name of dictionary from which this function is instantiated
|
//- Name of dictionary from which this function is instantiated
|
||||||
fileName dictName_;
|
const fileName dictName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,30 +25,6 @@ License
|
|||||||
|
|
||||||
#include "Scale2.H"
|
#include "Scale2.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::Function2s::Scale<Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
scale_ = Function2<scalar>::New("scale", dict);
|
|
||||||
xScale_ =
|
|
||||||
dict.found("xScale")
|
|
||||||
? Function1<scalar>::New("xScale", dict)
|
|
||||||
: autoPtr<Function1<scalar>>
|
|
||||||
(
|
|
||||||
new Function1s::Constant<scalar>("xScale", 1)
|
|
||||||
);
|
|
||||||
yScale_ =
|
|
||||||
dict.found("yScale")
|
|
||||||
? Function1<scalar>::New("yScale", dict)
|
|
||||||
: autoPtr<Function1<scalar>>
|
|
||||||
(
|
|
||||||
new Function1s::Constant<scalar>("yScale", 1)
|
|
||||||
);
|
|
||||||
value_ = Function2<Type>::New("value", dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -58,10 +34,28 @@ Foam::Function2s::Scale<Type>::Scale
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction2<Type, Scale<Type>>(name)
|
FieldFunction2<Type, Scale<Type>>(name),
|
||||||
{
|
scale_(Function2<scalar>::New("scale", dict)),
|
||||||
read(dict);
|
xScale_
|
||||||
}
|
(
|
||||||
|
dict.found("xScale")
|
||||||
|
? Function1<scalar>::New("xScale", dict)
|
||||||
|
: autoPtr<Function1<scalar>>
|
||||||
|
(
|
||||||
|
new Function1s::Constant<scalar>("xScale", 1)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
yScale_
|
||||||
|
(
|
||||||
|
dict.found("yScale")
|
||||||
|
? Function1<scalar>::New("yScale", dict)
|
||||||
|
: autoPtr<Function1<scalar>>
|
||||||
|
(
|
||||||
|
new Function1s::Constant<scalar>("yScale", 1)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
value_(Function2<Type>::New("value", dict))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -63,22 +63,16 @@ class Scale
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
//- Scalar scaling function
|
//- Scalar scaling function
|
||||||
autoPtr<Function2<scalar>> scale_;
|
const autoPtr<Function2<scalar>> scale_;
|
||||||
|
|
||||||
//- Argument scaling function
|
//- Argument scaling function
|
||||||
autoPtr<Function1<scalar>> xScale_;
|
const autoPtr<Function1<scalar>> xScale_;
|
||||||
|
|
||||||
//- Argument scaling function
|
//- Argument scaling function
|
||||||
autoPtr<Function1<scalar>> yScale_;
|
const autoPtr<Function1<scalar>> yScale_;
|
||||||
|
|
||||||
//- Value function
|
//- Value function
|
||||||
autoPtr<Function2<Type>> value_;
|
const autoPtr<Function2<Type>> value_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,14 +36,6 @@ namespace Function1s
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::Function1s::turbulentBL::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
exponent_ = dict.lookupOrDefault<scalar>("exponent", 1.0/7.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Function1s::turbulentBL::turbulentBL
|
Foam::Function1s::turbulentBL::turbulentBL
|
||||||
@ -52,10 +44,9 @@ Foam::Function1s::turbulentBL::turbulentBL
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
FieldFunction1<scalar, turbulentBL>(name)
|
FieldFunction1<scalar, turbulentBL>(name),
|
||||||
{
|
exponent_(dict.lookupOrDefault<scalar>("exponent", 1.0/7.0))
|
||||||
read(dict);
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,13 +75,7 @@ class turbulentBL
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Exponent of the pow function
|
//- Exponent of the pow function
|
||||||
scalar exponent_;
|
const scalar exponent_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -36,15 +36,6 @@ namespace Function1s
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::Function1s::crankConnectingRodMotion::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
conRodLength_ = dict.lookup<scalar>("conRodLength");
|
|
||||||
stroke_ = dict.lookup<scalar>("stroke");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Function1s::crankConnectingRodMotion::crankConnectingRodMotion
|
Foam::Function1s::crankConnectingRodMotion::crankConnectingRodMotion
|
||||||
@ -53,10 +44,10 @@ Foam::Function1s::crankConnectingRodMotion::crankConnectingRodMotion
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Function1<scalar>(name)
|
Function1<scalar>(name),
|
||||||
{
|
conRodLength_(dict.lookup<scalar>("conRodLength")),
|
||||||
read(dict);
|
stroke_(dict.lookup<scalar>("stroke"))
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -73,16 +73,10 @@ class crankConnectingRodMotion
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Connecting-rod length
|
//- Connecting-rod length
|
||||||
scalar conRodLength_;
|
const scalar conRodLength_;
|
||||||
|
|
||||||
//- Stroke
|
//- Stroke
|
||||||
scalar stroke_;
|
const scalar stroke_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read the coefficients from the given dictionary
|
|
||||||
void read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,7 +57,7 @@ Foam::solidBodyMotionFunctions::rotatingMotion::rotatingMotion
|
|||||||
solidBodyMotionFunction(SBMFCoeffs, runTime),
|
solidBodyMotionFunction(SBMFCoeffs, runTime),
|
||||||
origin_(SBMFCoeffs_.lookup("origin")),
|
origin_(SBMFCoeffs_.lookup("origin")),
|
||||||
axis_(SBMFCoeffs_.lookup("axis")),
|
axis_(SBMFCoeffs_.lookup("axis")),
|
||||||
omega_(SBMFCoeffs_)
|
omega_(new Function1s::omega(SBMFCoeffs_))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ Foam::solidBodyMotionFunctions::rotatingMotion::transformation() const
|
|||||||
const scalar t = time_.value();
|
const scalar t = time_.value();
|
||||||
|
|
||||||
// Rotation around axis
|
// Rotation around axis
|
||||||
const scalar angle = omega_.integral(0, t);
|
const scalar angle = omega_->integral(0, t);
|
||||||
|
|
||||||
const quaternion R(axis_, angle);
|
const quaternion R(axis_, angle);
|
||||||
const septernion TR(septernion(-origin_)*R*septernion(origin_));
|
const septernion TR(septernion(-origin_)*R*septernion(origin_));
|
||||||
@ -93,7 +93,7 @@ bool Foam::solidBodyMotionFunctions::rotatingMotion::read
|
|||||||
{
|
{
|
||||||
solidBodyMotionFunction::read(SBMFCoeffs);
|
solidBodyMotionFunction::read(SBMFCoeffs);
|
||||||
|
|
||||||
omega_.read(SBMFCoeffs);
|
omega_.reset(new Function1s::omega(SBMFCoeffs));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,7 +66,7 @@ class rotatingMotion
|
|||||||
const vector axis_;
|
const vector axis_;
|
||||||
|
|
||||||
//- Angular velocity (rad/sec)
|
//- Angular velocity (rad/sec)
|
||||||
Function1s::omega omega_;
|
autoPtr<Function1s::omega> omega_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,10 +58,10 @@ class APIdiffCoef
|
|||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
// API vapour mass diffusivity function coefficients
|
// API vapour mass diffusivity function coefficients
|
||||||
scalar a_, b_, wf_, wa_;
|
const scalar a_, b_, wf_, wa_;
|
||||||
|
|
||||||
// Helper variables
|
// Helper variables
|
||||||
scalar alpha_, beta_;
|
const scalar alpha_, beta_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user