semiImplicitSource: Made operable on multiple different types
The scalarSemiImplicitSource, vectorSemiImplicitSource, etc...,
fvOptions have been replaced by a single semiImplicitSource fvOption.
This allows sources to be specified for multiple fields regardless of
type. For example:
massSource
{
type semiImplicitSource;
timeStart 1;
duration 500;
selectionMode points;
points
(
(0.075 0.2 0.05)
);
volumeMode absolute;
sources
{
thermo:rho.steam
{
explicit 1.0e-3; // kg/s
implicit 0;
}
U.steam
{
explicit (0 1e-1 0); // kg*m/s^2
implicit 0;
}
h.steam
{
explicit 3700; // kg*m^2/s^3
implicit 0;
}
}
}
This commit is contained in:
committed by
Will Bainbridge
parent
ad12d3a8c1
commit
b6f91de72c
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object porousZone;
|
object fvOptions;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ fixedTemperature
|
|||||||
|
|
||||||
fixedPower
|
fixedPower
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
active no;
|
active no;
|
||||||
selectionMode all;
|
selectionMode all;
|
||||||
|
|
||||||
@ -35,10 +35,18 @@ fixedPower
|
|||||||
|
|
||||||
power 100; // Set power (W)
|
power 100; // Set power (W)
|
||||||
|
|
||||||
injectionRateSuSp
|
sources
|
||||||
{
|
{
|
||||||
e ($power 0);
|
e
|
||||||
h ($power 0);
|
{
|
||||||
|
explicit $power;
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
h
|
||||||
|
{
|
||||||
|
explicit $power;
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,231 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "SemiImplicitSource.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "fvMatrices.H"
|
|
||||||
#include "fvmSup.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::wordList Foam::fv::SemiImplicitSource<Type>::volumeModeTypeNames_
|
|
||||||
(
|
|
||||||
IStringStream("(absolute specific)")()
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
typename Foam::fv::SemiImplicitSource<Type>::volumeModeType
|
|
||||||
Foam::fv::SemiImplicitSource<Type>::wordToVolumeModeType
|
|
||||||
(
|
|
||||||
const word& vmtName
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
forAll(volumeModeTypeNames_, i)
|
|
||||||
{
|
|
||||||
if (vmtName == volumeModeTypeNames_[i])
|
|
||||||
{
|
|
||||||
return volumeModeType(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown volumeMode type " << vmtName
|
|
||||||
<< ". Valid volumeMode types are:" << nl << volumeModeTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
|
|
||||||
return volumeModeType(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::word Foam::fv::SemiImplicitSource<Type>::volumeModeTypeToWord
|
|
||||||
(
|
|
||||||
const volumeModeType& vmtType
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (vmtType > volumeModeTypeNames_.size())
|
|
||||||
{
|
|
||||||
return "UNKNOWN";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return volumeModeTypeNames_[vmtType];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::fv::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
|
|
||||||
{
|
|
||||||
fieldNames_.setSize(dict.size());
|
|
||||||
Su_.setSize(fieldNames_.size());
|
|
||||||
Sp_.setSize(fieldNames_.size());
|
|
||||||
|
|
||||||
applied_.setSize(fieldNames_.size(), false);
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(dictionary, dict, iter)
|
|
||||||
{
|
|
||||||
fieldNames_[i] = iter().keyword();
|
|
||||||
const dictionary& fieldSubDict(iter().dict());
|
|
||||||
Su_.set(i, Function1<Type>::New("explicit", fieldSubDict));
|
|
||||||
Sp_.set(i, Function1<scalar>::New("implicit", fieldSubDict));
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set volume normalisation
|
|
||||||
if (volumeMode_ == vmAbsolute)
|
|
||||||
{
|
|
||||||
VDash_ = V_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::fv::SemiImplicitSource<Type>::SemiImplicitSource
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
cellSetOption(name, modelType, dict, mesh),
|
|
||||||
volumeMode_(vmAbsolute),
|
|
||||||
VDash_(1)
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::fv::SemiImplicitSource<Type>::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<Type>& eqn,
|
|
||||||
const label fieldi
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "SemiImplicitSource<" << pTraits<Type>::typeName
|
|
||||||
<< ">::addSup for source " << name_ << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalar t = mesh_.time().value();
|
|
||||||
|
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi();
|
|
||||||
|
|
||||||
typename GeometricField<Type, fvPatchField, volMesh>::Internal Su
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
name_ + fieldNames_[fieldi] + "Su",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensioned<Type>
|
|
||||||
(
|
|
||||||
"zero",
|
|
||||||
eqn.dimensions()/dimVolume,
|
|
||||||
Zero
|
|
||||||
),
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
UIndirectList<Type>(Su, cells_) = Su_[fieldi].value(t)/VDash_;
|
|
||||||
|
|
||||||
volScalarField::Internal Sp
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
name_ + fieldNames_[fieldi] + "Sp",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensioned<scalar>
|
|
||||||
(
|
|
||||||
"zero",
|
|
||||||
Su.dimensions()/psi.dimensions(),
|
|
||||||
0
|
|
||||||
),
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
UIndirectList<scalar>(Sp, cells_) = Sp_[fieldi].value(t)/VDash_;
|
|
||||||
|
|
||||||
eqn += Su + fvm::SuSp(Sp, psi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::fv::SemiImplicitSource<Type>::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<Type>& eqn,
|
|
||||||
const label fieldi
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "SemiImplicitSource<" << pTraits<Type>::typeName
|
|
||||||
<< ">::addSup for source " << name_ << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this->addSup(eqn, fieldi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
bool Foam::fv::SemiImplicitSource<Type>::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (cellSetOption::read(dict))
|
|
||||||
{
|
|
||||||
volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode"));
|
|
||||||
setFieldData(coeffs_.subDict("sources"));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,218 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::fv::SemiImplicitSource
|
|
||||||
|
|
||||||
Description
|
|
||||||
Semi-implicit source, described using an input dictionary. The injection
|
|
||||||
rate coefficients are specified as pairs of Su-Sp coefficients, i.e.
|
|
||||||
|
|
||||||
\f[
|
|
||||||
S(x) = S_u + S_p x
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where
|
|
||||||
\vartable
|
|
||||||
S(x) | net source for field 'x'
|
|
||||||
S_u | explicit source contribution
|
|
||||||
S_p | linearised implicit contribution
|
|
||||||
\endvartable
|
|
||||||
|
|
||||||
Example tabulated heat source specification for internal energy:
|
|
||||||
\verbatim
|
|
||||||
volumeMode absolute; // specific
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
e
|
|
||||||
{
|
|
||||||
explicit table ((0 0) (1.5 $power));
|
|
||||||
implicit 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Example coded heat source specification for enthalpy:
|
|
||||||
\verbatim
|
|
||||||
volumeMode absolute; // specific
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
h
|
|
||||||
{
|
|
||||||
explicit
|
|
||||||
{
|
|
||||||
type coded;
|
|
||||||
name heatInjection;
|
|
||||||
code
|
|
||||||
#{
|
|
||||||
// Power amplitude
|
|
||||||
const scalar powerAmplitude = 1000;
|
|
||||||
|
|
||||||
// x is the current time
|
|
||||||
return mag(powerAmplitude*sin(x));
|
|
||||||
#};
|
|
||||||
}
|
|
||||||
implicit 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Valid options for the \c volumeMode entry include:
|
|
||||||
- absolute: values are given as \<quantity\>
|
|
||||||
- specific: values are given as \<quantity\>/m3
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::fvOption
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
SemiImplicitSource.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef SemiImplicitSource_H
|
|
||||||
#define SemiImplicitSource_H
|
|
||||||
|
|
||||||
#include "cellSetOption.H"
|
|
||||||
#include "Function1.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class SemiImplicitSource Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
class SemiImplicitSource
|
|
||||||
:
|
|
||||||
public cellSetOption
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Public data
|
|
||||||
|
|
||||||
//- Enumeration for volume types
|
|
||||||
enum volumeModeType
|
|
||||||
{
|
|
||||||
vmAbsolute,
|
|
||||||
vmSpecific
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private member data
|
|
||||||
|
|
||||||
//- Word list of volume mode type names
|
|
||||||
static const wordList volumeModeTypeNames_;
|
|
||||||
|
|
||||||
//- Volume mode
|
|
||||||
volumeModeType volumeMode_;
|
|
||||||
|
|
||||||
//- Volume normalisation
|
|
||||||
scalar VDash_;
|
|
||||||
|
|
||||||
//- Explicit source functions for the fields
|
|
||||||
PtrList<Function1<Type>> Su_;
|
|
||||||
|
|
||||||
//- Implicit source functions for the fields
|
|
||||||
PtrList<Function1<scalar>> Sp_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
//- Helper function to convert from a word to a volumeModeType
|
|
||||||
volumeModeType wordToVolumeModeType(const word& vtName) const;
|
|
||||||
|
|
||||||
//- Helper function to convert from a volumeModeType to a word
|
|
||||||
word volumeModeTypeToWord(const volumeModeType& vtType) const;
|
|
||||||
|
|
||||||
//- Set the local field data
|
|
||||||
void setFieldData(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("SemiImplicitSource");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
SemiImplicitSource
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Evaluation
|
|
||||||
|
|
||||||
//- Add explicit contribution to equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
fvMatrix<Type>& eqn,
|
|
||||||
const label fieldi
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Add explicit contribution to compressible equation
|
|
||||||
virtual void addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<Type>& eqn,
|
|
||||||
const label fieldi
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// IO
|
|
||||||
|
|
||||||
//- Read source dictionary
|
|
||||||
virtual bool read(const dictionary& dict);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace fv
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "SemiImplicitSource.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,16 +23,365 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "makeFvOption.H"
|
#include "semiImplicitSource.H"
|
||||||
#include "SemiImplicitSource.H"
|
#include "fvMesh.H"
|
||||||
|
#include "fvMatrices.H"
|
||||||
|
#include "fvmSup.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makeFvOption(SemiImplicitSource, scalar);
|
namespace Foam
|
||||||
makeFvOption(SemiImplicitSource, vector);
|
{
|
||||||
makeFvOption(SemiImplicitSource, sphericalTensor);
|
namespace fv
|
||||||
makeFvOption(SemiImplicitSource, symmTensor);
|
{
|
||||||
makeFvOption(SemiImplicitSource, tensor);
|
defineTypeNameAndDebug(semiImplicitSource, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
cellSetOption,
|
||||||
|
semiImplicitSource,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
const char* NamedEnum<fv::semiImplicitSource::volumeMode, 2>::names[] =
|
||||||
|
{
|
||||||
|
"absolute",
|
||||||
|
"specific"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const Foam::NamedEnum<Foam::fv::semiImplicitSource::volumeMode, 2>
|
||||||
|
Foam::fv::semiImplicitSource::volumeModeNames_;
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * ** Private Member Functions ** * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::fv::semiImplicitSource::addSupType
|
||||||
|
(
|
||||||
|
fvMatrix<Type>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "semiImplicitSource<" << pTraits<Type>::typeName
|
||||||
|
<< ">::addSup for source " << name_ << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const scalar t = mesh_.time().value();
|
||||||
|
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi();
|
||||||
|
|
||||||
|
typename GeometricField<Type, fvPatchField, volMesh>::Internal Su
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
name_ + fieldNames_[fieldi] + "Su",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensioned<Type>
|
||||||
|
(
|
||||||
|
"zero",
|
||||||
|
eqn.dimensions()/dimVolume,
|
||||||
|
Zero
|
||||||
|
),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Explicit source function for the field
|
||||||
|
autoPtr<Function1<Type>> SuFun1
|
||||||
|
(
|
||||||
|
Function1<Type>::New("explicit", fieldDicts_[fieldi])
|
||||||
|
);
|
||||||
|
UIndirectList<Type>(Su, cells_) = SuFun1->value(t)/VDash_;
|
||||||
|
|
||||||
|
volScalarField::Internal Sp
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
name_ + fieldNames_[fieldi] + "Sp",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensioned<scalar>
|
||||||
|
(
|
||||||
|
"zero",
|
||||||
|
Su.dimensions()/psi.dimensions(),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Implicit source function for the field
|
||||||
|
autoPtr<Function1<scalar>> SpFun1
|
||||||
|
(
|
||||||
|
Function1<scalar>::New("implicit", fieldDicts_[fieldi])
|
||||||
|
);
|
||||||
|
UIndirectList<scalar>(Sp, cells_) = SpFun1->value(t)/VDash_;
|
||||||
|
|
||||||
|
eqn += Su + fvm::SuSp(Sp, psi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::fv::semiImplicitSource::addSupType
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<Type>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "semiImplicitSource<" << pTraits<Type>::typeName
|
||||||
|
<< ">::addSup for source " << name_ << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this->addSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::semiImplicitSource::semiImplicitSource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
|
volumeMode_(volumeMode::absolute),
|
||||||
|
VDash_(1)
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::semiImplicitSource::~semiImplicitSource()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::semiImplicitSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSupType(eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::semiImplicitSource::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (cellSetOption::read(dict))
|
||||||
|
{
|
||||||
|
volumeMode_ = volumeModeNames_.read(coeffs_.lookup("volumeMode"));
|
||||||
|
|
||||||
|
const dictionary& sources = coeffs_.subDict("sources");
|
||||||
|
|
||||||
|
// Number of the fields with source term
|
||||||
|
const label nFields = sources.size();
|
||||||
|
|
||||||
|
// Names of the field
|
||||||
|
fieldNames_.setSize(nFields);
|
||||||
|
|
||||||
|
// Field dicts
|
||||||
|
fieldDicts_.setSize(nFields);
|
||||||
|
|
||||||
|
label i = 0;
|
||||||
|
forAllConstIter(dictionary, sources, iter)
|
||||||
|
{
|
||||||
|
fieldNames_[i] = iter().keyword();
|
||||||
|
fieldDicts_[i] = iter().dict();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set volume normalisation
|
||||||
|
if (volumeMode_ == volumeMode::absolute)
|
||||||
|
{
|
||||||
|
VDash_ = V_;
|
||||||
|
}
|
||||||
|
|
||||||
|
applied_.setSize(nFields, false);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -0,0 +1,309 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::fv::semiImplicitSource
|
||||||
|
|
||||||
|
Description
|
||||||
|
Semi-implicit source, described using an input dictionary. The injection
|
||||||
|
rate coefficients are specified as pairs of Su-Sp coefficients, i.e.
|
||||||
|
|
||||||
|
\f[
|
||||||
|
S(x) = S_u + S_p x
|
||||||
|
\f]
|
||||||
|
|
||||||
|
where
|
||||||
|
\vartable
|
||||||
|
S(x) | net source for field 'x'
|
||||||
|
S_u | explicit source contribution
|
||||||
|
S_p | linearised implicit contribution
|
||||||
|
\endvartable
|
||||||
|
|
||||||
|
Example tabulated heat source specification for internal energy:
|
||||||
|
\verbatim
|
||||||
|
volumeMode absolute; // specific
|
||||||
|
sources
|
||||||
|
{
|
||||||
|
e
|
||||||
|
{
|
||||||
|
explicit table ((0 0) (1.5 $power));
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Example coded heat source specification for enthalpy:
|
||||||
|
\verbatim
|
||||||
|
volumeMode absolute; // specific
|
||||||
|
sources
|
||||||
|
{
|
||||||
|
h
|
||||||
|
{
|
||||||
|
explicit
|
||||||
|
{
|
||||||
|
type coded;
|
||||||
|
name heatInjection;
|
||||||
|
code
|
||||||
|
#{
|
||||||
|
// Power amplitude
|
||||||
|
const scalar powerAmplitude = 1000;
|
||||||
|
|
||||||
|
// x is the current time
|
||||||
|
return mag(powerAmplitude*sin(x));
|
||||||
|
#};
|
||||||
|
}
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Valid options for the \c volumeMode entry include:
|
||||||
|
- absolute: values are given as \<quantity\>
|
||||||
|
- specific: values are given as \<quantity\>/m3
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::fvOption
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
semiImplicitSource.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef semiImplicitSource_H
|
||||||
|
#define semiImplicitSource_H
|
||||||
|
|
||||||
|
#include "cellSetOption.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class semiImplicitSource Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class semiImplicitSource
|
||||||
|
:
|
||||||
|
public cellSetOption
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public data
|
||||||
|
|
||||||
|
//- Enumeration for volume types
|
||||||
|
enum class volumeMode
|
||||||
|
{
|
||||||
|
absolute,
|
||||||
|
specific
|
||||||
|
};
|
||||||
|
|
||||||
|
//- Property type names
|
||||||
|
static const NamedEnum<volumeMode, 2> volumeModeNames_;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private member data
|
||||||
|
|
||||||
|
//- Volume mode
|
||||||
|
volumeMode volumeMode_;
|
||||||
|
|
||||||
|
//- Volume normalisation
|
||||||
|
scalar VDash_;
|
||||||
|
|
||||||
|
//- Explicit/Implicit source dicts
|
||||||
|
List<dictionary> fieldDicts_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private member functions
|
||||||
|
|
||||||
|
//- Add divergence terms to an equation
|
||||||
|
template <class Type>
|
||||||
|
void addSupType(fvMatrix<Type>&, const label);
|
||||||
|
|
||||||
|
//- Add divergence terms to an equation
|
||||||
|
template <class Type>
|
||||||
|
void addSupType(const volScalarField&, fvMatrix<Type>&, const label);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("semiImplicitSource");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
semiImplicitSource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~semiImplicitSource();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Evaluation
|
||||||
|
|
||||||
|
// Explicit and implicit sources
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit and implicit sources for compressible equations
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit and implicit sources for phase equations
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Read source dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -19,15 +19,23 @@ options
|
|||||||
{
|
{
|
||||||
massSource
|
massSource
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
selectionMode all;
|
selectionMode all;
|
||||||
volumeMode specific;
|
volumeMode specific;
|
||||||
|
|
||||||
injectionRateSuSp
|
sources
|
||||||
{
|
{
|
||||||
thermo:rho.air (0.024535 0);// kg/s/m³
|
thermo:rho.air
|
||||||
thermo:rho.water (-24.535 0); // kg/s/m³
|
{
|
||||||
|
explicit 0.024535; // kg/s/m^3
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
thermo:rho.water
|
||||||
|
{
|
||||||
|
explicit -24.535; // kg/s/m^3
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,17 +17,25 @@ FoamFile
|
|||||||
|
|
||||||
options
|
options
|
||||||
{
|
{
|
||||||
massSource1
|
massSource
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
selectionMode all;
|
selectionMode all;
|
||||||
volumeMode specific;
|
volumeMode specific;
|
||||||
|
|
||||||
injectionRateSuSp
|
sources
|
||||||
{
|
{
|
||||||
thermo:rho.air (-0.0258575 0); // kg/s/m³
|
thermo:rho.air
|
||||||
thermo:rho.water (25.8575 0); // kg/s/m³
|
{
|
||||||
|
explicit -0.0258575; // kg/s/m^3
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
thermo:rho.water
|
||||||
|
{
|
||||||
|
explicit 25.8575; // kg/s/m^3
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object porousZone;
|
object fvOptions;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ fixedTemperature
|
|||||||
|
|
||||||
fixedPower
|
fixedPower
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
active no;
|
active no;
|
||||||
selectionMode all;
|
selectionMode all;
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ options
|
|||||||
{
|
{
|
||||||
energySource
|
energySource
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0;
|
timeStart 0;
|
||||||
duration 1e6;
|
duration 1e6;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ options
|
|||||||
{
|
{
|
||||||
energySource
|
energySource
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0;
|
timeStart 0;
|
||||||
duration 1;
|
duration 1;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
momentumSource
|
momentumSource
|
||||||
{
|
{
|
||||||
type vectorSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0.0;
|
timeStart 0.0;
|
||||||
duration 1000;
|
duration 1000;
|
||||||
|
|||||||
@ -44,9 +44,9 @@ filter1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
massSource1
|
massSource
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0.2;
|
timeStart 0.2;
|
||||||
duration 2.0;
|
duration 2.0;
|
||||||
@ -66,9 +66,9 @@ massSource1
|
|||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
H2O
|
U
|
||||||
{
|
{
|
||||||
explicit 1e-4; // kg/s
|
explicit (0 0.005 0);
|
||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,29 +77,10 @@ massSource1
|
|||||||
explicit 10;
|
explicit 10;
|
||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
H2O
|
||||||
momentumSource1
|
|
||||||
{
|
{
|
||||||
type vectorSemiImplicitSource;
|
explicit 1e-4; // kg/s
|
||||||
|
|
||||||
timeStart 0.2;
|
|
||||||
duration 2.0;
|
|
||||||
selectionMode points;
|
|
||||||
points
|
|
||||||
(
|
|
||||||
(2.75 0.5 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volumeMode absolute;
|
|
||||||
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
U
|
|
||||||
{
|
|
||||||
explicit (0 0.005 0);
|
|
||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,24 +15,20 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
injector1
|
options
|
||||||
{
|
{
|
||||||
|
massSource
|
||||||
|
{
|
||||||
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0;
|
timeStart 0;
|
||||||
duration 1e6;
|
duration 1e6;
|
||||||
|
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
points
|
points
|
||||||
(
|
(
|
||||||
(0.075 0.925 0.05)
|
(0.075 0.925 0.05)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
options
|
|
||||||
{
|
|
||||||
massSource1
|
|
||||||
{
|
|
||||||
type scalarSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
|
|
||||||
|
|||||||
@ -15,24 +15,20 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
injector1
|
options
|
||||||
{
|
{
|
||||||
|
massSource
|
||||||
|
{
|
||||||
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0.1;
|
timeStart 0.1;
|
||||||
duration 5;
|
duration 5;
|
||||||
|
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
points
|
points
|
||||||
(
|
(
|
||||||
(0.075 0.2 0.05)
|
(0.075 0.2 0.05)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
options
|
|
||||||
{
|
|
||||||
massSource1
|
|
||||||
{
|
|
||||||
type scalarSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
|
|
||||||
@ -44,6 +40,12 @@ options
|
|||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
U.air
|
||||||
|
{
|
||||||
|
explicit (0 -1e-2 0); // kg*m/s^2
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
|
||||||
e.air
|
e.air
|
||||||
{
|
{
|
||||||
explicit 500; // kg*m^2/s^3
|
explicit 500; // kg*m^2/s^3
|
||||||
@ -51,24 +53,6 @@ options
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
momentumSource1
|
|
||||||
{
|
|
||||||
type vectorSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
|
||||||
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
U.air
|
|
||||||
{
|
|
||||||
explicit (0 -1e-2 0); // kg*m/s^2
|
|
||||||
implicit 0; // kg*m/s^2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,24 +15,20 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
injector1
|
options
|
||||||
{
|
{
|
||||||
|
massSource
|
||||||
|
{
|
||||||
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 1;
|
timeStart 1;
|
||||||
duration 500;
|
duration 500;
|
||||||
|
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
points
|
points
|
||||||
(
|
(
|
||||||
(0.075 0.2 0.05)
|
(0.075 0.2 0.05)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
options
|
|
||||||
{
|
|
||||||
massSource1
|
|
||||||
{
|
|
||||||
type scalarSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
|
|
||||||
@ -44,29 +40,17 @@ options
|
|||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h.steam
|
|
||||||
{
|
|
||||||
explicit 3700; // kg*m^2/s^3
|
|
||||||
implicit 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
momentumSource1
|
|
||||||
{
|
|
||||||
type vectorSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
|
||||||
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
U.steam
|
U.steam
|
||||||
{
|
{
|
||||||
explicit (0 1e-1 0); // kg*m/s^2
|
explicit (0 1e-1 0); // kg*m/s^2
|
||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h.steam
|
||||||
|
{
|
||||||
|
explicit 3700; // kg*m^2/s^3
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,24 +15,20 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
injector1
|
options
|
||||||
{
|
{
|
||||||
|
massSource
|
||||||
|
{
|
||||||
|
type semiImplicitSource;
|
||||||
|
|
||||||
timeStart 0.1;
|
timeStart 0.1;
|
||||||
duration 5;
|
duration 5;
|
||||||
|
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
points
|
points
|
||||||
(
|
(
|
||||||
(0.075 0.2 0.05)
|
(0.075 0.2 0.05)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
options
|
|
||||||
{
|
|
||||||
massSource1
|
|
||||||
{
|
|
||||||
type scalarSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
|
|
||||||
@ -44,6 +40,12 @@ options
|
|||||||
implicit 0;
|
implicit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
U.air
|
||||||
|
{
|
||||||
|
explicit (0 -1e-2 0); // kg*m/s^2
|
||||||
|
implicit 0;
|
||||||
|
}
|
||||||
|
|
||||||
e.air
|
e.air
|
||||||
{
|
{
|
||||||
explicit 500; // kg*m^2/s^3
|
explicit 500; // kg*m^2/s^3
|
||||||
@ -51,24 +53,6 @@ options
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
momentumSource1
|
|
||||||
{
|
|
||||||
type vectorSemiImplicitSource;
|
|
||||||
|
|
||||||
$injector1;
|
|
||||||
|
|
||||||
volumeMode absolute;
|
|
||||||
|
|
||||||
sources
|
|
||||||
{
|
|
||||||
U.air
|
|
||||||
{
|
|
||||||
explicit (0 -1e-2 0); // kg*m/s^2
|
|
||||||
implicit 0; // kg*m/s^2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user