mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fvOptions: Separate options for all cells, cellSets and inter-region coupling
by introducing rational base-classes rather than using the hideous 'switch' statement. Further rationalization of the cell-selection mechanism will be implemented via an appropriate class hierarchy to replace the remaining 'switch' statement. Mesh-motion is currently handled very inefficiently for cellSets and not at all for inter-region coupling. The former will be improved when the cell-selection classes are written and the latter by making the meshToMesh class a MeshObject after it has been corrected for mapFields.
This commit is contained in:
@ -1,10 +1,16 @@
|
|||||||
fvOptions/fvOption.C
|
fvOption/fvOption.C
|
||||||
fvOptions/fvOptionIO.C
|
fvOption/fvOptionIO.C
|
||||||
fvOptions/fvOptionList.C
|
fvOption/fvOptionList.C
|
||||||
fvOptions/fvIOoptionList.C
|
fvOption/fvIOoptionList.C
|
||||||
|
|
||||||
|
cellSetOption/cellSetOption.C
|
||||||
|
cellSetOption/cellSetOptionIO.C
|
||||||
|
|
||||||
|
interRegionOption/interRegionOption.C
|
||||||
|
interRegionOption/interRegionOptionIO.C
|
||||||
|
|
||||||
|
|
||||||
/* sources */
|
/* Sources */
|
||||||
|
|
||||||
generalSources=sources/general
|
generalSources=sources/general
|
||||||
$(generalSources)/codedSource/codedSource.C
|
$(generalSources)/codedSource/codedSource.C
|
||||||
@ -32,16 +38,17 @@ $(derivedSources)/solidificationMeltingSource/solidificationMeltingSourceIO.C
|
|||||||
$(derivedSources)/tabulatedAccelerationSource/tabulatedAccelerationSource.C
|
$(derivedSources)/tabulatedAccelerationSource/tabulatedAccelerationSource.C
|
||||||
$(derivedSources)/tabulatedAccelerationSource/tabulated6DoFAcceleration/tabulated6DoFAcceleration.C
|
$(derivedSources)/tabulatedAccelerationSource/tabulated6DoFAcceleration/tabulated6DoFAcceleration.C
|
||||||
|
|
||||||
|
|
||||||
interRegion = sources/interRegion
|
interRegion = sources/interRegion
|
||||||
$(interRegion)/interRegionHeatTransferModel/constantHeatTransfer/constantHeatTransfer.C
|
$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
||||||
$(interRegion)/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelIO.C
|
||||||
$(interRegion)/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C
|
$(interRegion)/interRegionHeatTransfer/constantHeatTransfer/constantHeatTransfer.C
|
||||||
$(interRegion)/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C
|
$(interRegion)/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C
|
||||||
|
$(interRegion)/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C
|
||||||
$(interRegion)/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
|
$(interRegion)/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
|
||||||
|
|
||||||
|
|
||||||
|
/* Constraints */
|
||||||
/* constraints */
|
|
||||||
|
|
||||||
generalConstraints=constraints/general
|
generalConstraints=constraints/general
|
||||||
$(generalConstraints)/explicitSetValue/explicitSetValue.C
|
$(generalConstraints)/explicitSetValue/explicitSetValue.C
|
||||||
|
|||||||
237
src/fvOptions/cellSetOption/cellSetOption.C
Normal file
237
src/fvOptions/cellSetOption/cellSetOption.C
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "cellSetOption.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(cellSetOption, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> const char* NamedEnum
|
||||||
|
<
|
||||||
|
fv::cellSetOption::selectionModeType,
|
||||||
|
4
|
||||||
|
>::names[] =
|
||||||
|
{
|
||||||
|
"points",
|
||||||
|
"cellSet",
|
||||||
|
"cellZone",
|
||||||
|
"all"
|
||||||
|
};
|
||||||
|
|
||||||
|
const NamedEnum<fv::cellSetOption::selectionModeType, 4>
|
||||||
|
fv::cellSetOption::selectionModeTypeNames_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::cellSetOption::setSelection(const dictionary& dict)
|
||||||
|
{
|
||||||
|
switch (selectionMode_)
|
||||||
|
{
|
||||||
|
case smPoints:
|
||||||
|
{
|
||||||
|
dict.lookup("points") >> points_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smCellSet:
|
||||||
|
{
|
||||||
|
dict.lookup("cellSet") >> cellSetName_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smCellZone:
|
||||||
|
{
|
||||||
|
dict.lookup("cellZone") >> cellSetName_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smAll:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn("::setSelection(const dictionary&)")
|
||||||
|
<< "Unknown selectionMode "
|
||||||
|
<< selectionModeTypeNames_[selectionMode_]
|
||||||
|
<< ". Valid selectionMode types are" << selectionModeTypeNames_
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::cellSetOption::setCellSet()
|
||||||
|
{
|
||||||
|
switch (selectionMode_)
|
||||||
|
{
|
||||||
|
case smPoints:
|
||||||
|
{
|
||||||
|
Info<< indent << "- selecting cells using points" << endl;
|
||||||
|
|
||||||
|
labelHashSet selectedCells;
|
||||||
|
|
||||||
|
forAll(points_, i)
|
||||||
|
{
|
||||||
|
label cellI = mesh_.findCell(points_[i]);
|
||||||
|
if (cellI >= 0)
|
||||||
|
{
|
||||||
|
selectedCells.insert(cellI);
|
||||||
|
}
|
||||||
|
|
||||||
|
label globalCellI = returnReduce(cellI, maxOp<label>());
|
||||||
|
if (globalCellI < 0)
|
||||||
|
{
|
||||||
|
WarningIn("cellSetOption::setCellSet()")
|
||||||
|
<< "Unable to find owner cell for point " << points_[i]
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
cells_ = selectedCells.toc();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smCellSet:
|
||||||
|
{
|
||||||
|
Info<< indent
|
||||||
|
<< "- selecting cells using cellSet " << cellSetName_ << endl;
|
||||||
|
|
||||||
|
cellSet selectedCells(mesh_, cellSetName_);
|
||||||
|
cells_ = selectedCells.toc();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smCellZone:
|
||||||
|
{
|
||||||
|
Info<< indent
|
||||||
|
<< "- selecting cells using cellZone " << cellSetName_ << endl;
|
||||||
|
|
||||||
|
label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
|
||||||
|
if (zoneID == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn("cellSetOption::setCellIds()")
|
||||||
|
<< "Cannot find cellZone " << cellSetName_ << endl
|
||||||
|
<< "Valid cellZones are " << mesh_.cellZones().names()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
cells_ = mesh_.cellZones()[zoneID];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case smAll:
|
||||||
|
{
|
||||||
|
Info<< indent << "- selecting all cells" << endl;
|
||||||
|
cells_ = identity(mesh_.nCells());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn("cellSetOption::setCellSet()")
|
||||||
|
<< "Unknown selectionMode "
|
||||||
|
<< selectionModeTypeNames_[selectionMode_]
|
||||||
|
<< ". Valid selectionMode types are" << selectionModeTypeNames_
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set volume information
|
||||||
|
V_ = 0.0;
|
||||||
|
forAll(cells_, i)
|
||||||
|
{
|
||||||
|
V_ += mesh_.V()[cells_[i]];
|
||||||
|
}
|
||||||
|
reduce(V_, sumOp<scalar>());
|
||||||
|
|
||||||
|
Info<< indent
|
||||||
|
<< "- selected " << returnReduce(cells_.size(), sumOp<label>())
|
||||||
|
<< " cell(s) with volume " << V_ << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::cellSetOption::cellSetOption
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option(name, modelType, dict, mesh),
|
||||||
|
timeStart_(-1.0),
|
||||||
|
duration_(0.0),
|
||||||
|
selectionMode_
|
||||||
|
(
|
||||||
|
selectionModeTypeNames_.read(coeffs_.lookup("selectionMode"))
|
||||||
|
),
|
||||||
|
cellSetName_("none"),
|
||||||
|
V_(0.0)
|
||||||
|
{
|
||||||
|
Info<< incrIndent;
|
||||||
|
read(dict);
|
||||||
|
setSelection(coeffs_);
|
||||||
|
setCellSet();
|
||||||
|
Info<< decrIndent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::cellSetOption::~cellSetOption()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::fv::cellSetOption::isActive()
|
||||||
|
{
|
||||||
|
if (option::isActive() && inTimeLimits(mesh_.time().value()))
|
||||||
|
{
|
||||||
|
// Update the cell set if the mesh is changing
|
||||||
|
if (mesh_.changing())
|
||||||
|
{
|
||||||
|
setCellSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
222
src/fvOptions/cellSetOption/cellSetOption.H
Normal file
222
src/fvOptions/cellSetOption/cellSetOption.H
Normal file
@ -0,0 +1,222 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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::cellSetOption
|
||||||
|
|
||||||
|
Description
|
||||||
|
Cell-set options abtract base class. Provides a base set of controls,
|
||||||
|
e.g.
|
||||||
|
|
||||||
|
type scalarExplicitSource // Source type
|
||||||
|
active on; // on/off switch
|
||||||
|
|
||||||
|
scalarExplicitSourceCoeffs
|
||||||
|
{
|
||||||
|
timeStart 0.0; // Start time
|
||||||
|
duration 1000.0; // Duration
|
||||||
|
selectionMode cellSet; // cellSet, points, cellZone
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
}
|
||||||
|
|
||||||
|
Note:
|
||||||
|
Source/sink options are to be added to the equation R.H.S.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
cellSetOption.C
|
||||||
|
cellSetOptionIO.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef cellSetOption_H
|
||||||
|
#define cellSetOption_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
#include "cellSet.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class cellSetOption Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class cellSetOption
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public data
|
||||||
|
|
||||||
|
//- Enumeration for selection mode types
|
||||||
|
enum selectionModeType
|
||||||
|
{
|
||||||
|
smPoints,
|
||||||
|
smCellSet,
|
||||||
|
smCellZone,
|
||||||
|
smAll
|
||||||
|
};
|
||||||
|
|
||||||
|
//- Word list of selection mode type names
|
||||||
|
static const NamedEnum<selectionModeType, 4>
|
||||||
|
selectionModeTypeNames_;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Time start
|
||||||
|
scalar timeStart_;
|
||||||
|
|
||||||
|
//- Duration
|
||||||
|
scalar duration_;
|
||||||
|
|
||||||
|
//- Cell selection mode
|
||||||
|
selectionModeType selectionMode_;
|
||||||
|
|
||||||
|
//- Name of cell set for "cellSet" and "cellZone" selectionMode
|
||||||
|
word cellSetName_;
|
||||||
|
|
||||||
|
//- List of points for "points" selectionMode
|
||||||
|
List<point> points_;
|
||||||
|
|
||||||
|
//- Set of cells to apply source to
|
||||||
|
labelList cells_;
|
||||||
|
|
||||||
|
//- Sum of cell volumes
|
||||||
|
scalar V_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected functions
|
||||||
|
|
||||||
|
//- Set the cellSet or points selection
|
||||||
|
void setSelection(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Set the cell set based on the user input selection mode
|
||||||
|
void setCellSet();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("cellSetOption");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
cellSetOption
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~cellSetOption();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the time start
|
||||||
|
inline scalar timeStart() const;
|
||||||
|
|
||||||
|
//- Return const access to the duration
|
||||||
|
inline scalar duration() const;
|
||||||
|
|
||||||
|
//- Return true if within time limits
|
||||||
|
inline bool inTimeLimits(const scalar time) const;
|
||||||
|
|
||||||
|
//- Return const access to the cell selection mode
|
||||||
|
inline const selectionModeType& selectionMode() const;
|
||||||
|
|
||||||
|
//- Return const access to the name of cell set for "cellSet"
|
||||||
|
// selectionMode
|
||||||
|
inline const word& cellSetName() const;
|
||||||
|
|
||||||
|
//- Return const access to the total cell volume
|
||||||
|
inline scalar V() const;
|
||||||
|
|
||||||
|
//- Return const access to the cell set
|
||||||
|
inline const labelList& cells() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Edit
|
||||||
|
|
||||||
|
//- Return access to the time start
|
||||||
|
inline scalar& timeStart();
|
||||||
|
|
||||||
|
//- Return access to the duration
|
||||||
|
inline scalar& duration();
|
||||||
|
|
||||||
|
|
||||||
|
// Checks
|
||||||
|
|
||||||
|
//- Is the source active?
|
||||||
|
virtual bool isActive();
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the source header information
|
||||||
|
virtual void writeHeader(Ostream&) const;
|
||||||
|
|
||||||
|
//- Write the source footer information
|
||||||
|
virtual void writeFooter(Ostream&) const;
|
||||||
|
|
||||||
|
//- Write the source properties
|
||||||
|
virtual void writeData(Ostream&) const;
|
||||||
|
|
||||||
|
//- Read source dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "cellSetOptionI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
91
src/fvOptions/cellSetOption/cellSetOptionI.H
Normal file
91
src/fvOptions/cellSetOption/cellSetOptionI.H
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::fv::cellSetOption::timeStart() const
|
||||||
|
{
|
||||||
|
return timeStart_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::fv::cellSetOption::duration() const
|
||||||
|
{
|
||||||
|
return duration_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::fv::cellSetOption::inTimeLimits(const scalar time) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
(timeStart_ < 0)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
(mesh_.time().value() >= timeStart_)
|
||||||
|
&& (mesh_.time().value() <= (timeStart_ + duration_))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::fv::cellSetOption::selectionModeType&
|
||||||
|
Foam::fv::cellSetOption::selectionMode() const
|
||||||
|
{
|
||||||
|
return selectionMode_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::word& Foam::fv::cellSetOption::cellSetName() const
|
||||||
|
{
|
||||||
|
return cellSetName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::fv::cellSetOption::V() const
|
||||||
|
{
|
||||||
|
return V_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::labelList& Foam::fv::cellSetOption::cells() const
|
||||||
|
{
|
||||||
|
return cells_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar& Foam::fv::cellSetOption::timeStart()
|
||||||
|
{
|
||||||
|
return timeStart_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar& Foam::fv::cellSetOption::duration()
|
||||||
|
{
|
||||||
|
return duration_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,26 +23,27 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::option::writeHeader(Ostream& os) const
|
void Foam::fv::cellSetOption::writeHeader(Ostream& os) const
|
||||||
{
|
{
|
||||||
os << indent << name_ << nl
|
os << indent << name_ << nl
|
||||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::writeFooter(Ostream& os) const
|
void Foam::fv::cellSetOption::writeFooter(Ostream& os) const
|
||||||
{
|
{
|
||||||
os << decrIndent << indent << token::END_BLOCK << endl;
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::writeData(Ostream& os) const
|
void Foam::fv::cellSetOption::writeData(Ostream& os) const
|
||||||
{
|
{
|
||||||
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl;
|
option::writeData(os);
|
||||||
|
|
||||||
os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl;
|
os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl;
|
os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("selectionMode")
|
os.writeKeyword("selectionMode")
|
||||||
@ -72,10 +73,6 @@ void Foam::fv::option::writeData(Ostream& os) const
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case smMapRegion:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorIn("option::writeData(Ostream&) const")
|
FatalErrorIn("option::writeData(Ostream&) const")
|
||||||
@ -87,16 +84,15 @@ void Foam::fv::option::writeData(Ostream& os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::fv::option::read(const dictionary& dict)
|
bool Foam::fv::cellSetOption::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
active_ = readBool(dict.lookup("active"));
|
if (option::read(dict))
|
||||||
|
|
||||||
if (dict.readIfPresent("timeStart", timeStart_))
|
|
||||||
{
|
{
|
||||||
dict.lookup("duration") >> duration_;
|
if (coeffs_.readIfPresent("timeStart", timeStart_))
|
||||||
|
{
|
||||||
|
coeffs_.lookup("duration") >> duration_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
coeffs_ = dict.subDict(modelType_ + "Coeffs");
|
|
||||||
|
|
||||||
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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -67,7 +67,7 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))),
|
mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))),
|
||||||
Tuniform_(NULL),
|
Tuniform_(NULL),
|
||||||
TName_("T")
|
TName_("T")
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,7 +52,7 @@ SourceFiles
|
|||||||
#ifndef fixedTemperatureConstraint_H
|
#ifndef fixedTemperatureConstraint_H
|
||||||
#define fixedTemperatureConstraint_H
|
#define fixedTemperatureConstraint_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
#include "DataEntry.H"
|
#include "DataEntry.H"
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ namespace fv
|
|||||||
|
|
||||||
class fixedTemperatureConstraint
|
class fixedTemperatureConstraint
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,7 +54,7 @@ Foam::fv::temperatureLimitsConstraint::temperatureLimitsConstraint
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
Tmin_(readScalar(coeffs_.lookup("Tmin"))),
|
Tmin_(readScalar(coeffs_.lookup("Tmin"))),
|
||||||
Tmax_(readScalar(coeffs_.lookup("Tmax")))
|
Tmax_(readScalar(coeffs_.lookup("Tmax")))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,7 +45,7 @@ SourceFiles
|
|||||||
#ifndef temperatureLimitsConstraint_H
|
#ifndef temperatureLimitsConstraint_H
|
||||||
#define temperatureLimitsConstraint_H
|
#define temperatureLimitsConstraint_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace fv
|
|||||||
|
|
||||||
class temperatureLimitsConstraint
|
class temperatureLimitsConstraint
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,7 +59,7 @@ Foam::fv::ExplicitSetValue<Type>::ExplicitSetValue
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
injectionRate_()
|
injectionRate_()
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,7 +51,7 @@ SourceFiles
|
|||||||
#ifndef ExplicitSetValue_H
|
#ifndef ExplicitSetValue_H
|
||||||
#define ExplicitSetValue_H
|
#define ExplicitSetValue_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "Tuple2.H"
|
#include "Tuple2.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -68,7 +68,7 @@ namespace fv
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class ExplicitSetValue
|
class ExplicitSetValue
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
335
src/fvOptions/fvOption/fvOption.C
Normal file
335
src/fvOptions/fvOption/fvOption.C
Normal file
@ -0,0 +1,335 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "fvOption.H"
|
||||||
|
#include "fvMatrices.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(option, 0);
|
||||||
|
defineRunTimeSelectionTable(option, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::fv::option::alwaysApply() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::option::option
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
name_(name),
|
||||||
|
modelType_(modelType),
|
||||||
|
mesh_(mesh),
|
||||||
|
dict_(dict),
|
||||||
|
coeffs_(dict.subDict(modelType + "Coeffs")),
|
||||||
|
active_(dict_.lookupOrDefault<bool>("active", true)),
|
||||||
|
fieldNames_(),
|
||||||
|
applied_()
|
||||||
|
{
|
||||||
|
Info<< incrIndent << indent << "Source: " << name_ << endl;
|
||||||
|
Info<< decrIndent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const dictionary& coeffs,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
{
|
||||||
|
word modelType(coeffs.lookup("type"));
|
||||||
|
|
||||||
|
Info<< indent
|
||||||
|
<< "Selecting finite volume options model type " << modelType << endl;
|
||||||
|
|
||||||
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(modelType);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"option::New(const word&, const dictionary&, const fvMesh&)"
|
||||||
|
) << "Unknown Model type " << modelType << nl << nl
|
||||||
|
<< "Valid model types are:" << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fv::option::~option()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::fv::option::isActive()
|
||||||
|
{
|
||||||
|
return active_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::fv::option::applyToField(const word& fieldName) const
|
||||||
|
{
|
||||||
|
if (alwaysApply())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return findIndex(fieldNames_, fieldName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::checkApplied() const
|
||||||
|
{
|
||||||
|
forAll(applied_, i)
|
||||||
|
{
|
||||||
|
if (!applied_[i])
|
||||||
|
{
|
||||||
|
WarningIn("void option::checkApplied() const")
|
||||||
|
<< "Source " << name_ << " defined for field "
|
||||||
|
<< fieldNames_[i] << " but never used" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::correct(volScalarField& fld)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::correct(volVectorField& fld)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::correct(volSphericalTensorField& fld)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::correct(volSymmTensorField& fld)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::correct(volTensorField& fld)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSup(alpha*rho, eqn, fieldI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSup(alpha*rho, eqn, fieldI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSup(alpha*rho, eqn, fieldI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSup(alpha*rho, eqn, fieldI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addSup(alpha*rho, eqn, fieldI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::setValue(fvMatrix<scalar>& eqn, const label fieldI)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::setValue(fvMatrix<vector>& eqn, const label fieldI)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::setValue
|
||||||
|
(
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::setValue
|
||||||
|
(
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::setValue(fvMatrix<tensor>& eqn, const label fieldI)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -30,12 +30,9 @@ Description
|
|||||||
|
|
||||||
type scalarExplicitSource // source type
|
type scalarExplicitSource // source type
|
||||||
active on; // on/off switch
|
active on; // on/off switch
|
||||||
timeStart 0.0; // start time
|
|
||||||
duration 1000.0; // duration
|
|
||||||
selectionMode cellSet; // cellSet // points //cellZone
|
|
||||||
// mapRegion
|
|
||||||
Note:
|
Note:
|
||||||
On evaluation, source/sink options are to be added to the equation rhs
|
On evaluation, source/sink options are to be added to the equation R.H.S.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
fvOption.C
|
fvOption.C
|
||||||
@ -48,10 +45,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "fvMatricesFwd.H"
|
#include "fvMatricesFwd.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "cellSet.H"
|
#include "dictionary.H"
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "meshToMesh.H"
|
|
||||||
|
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -70,25 +64,6 @@ namespace fv
|
|||||||
|
|
||||||
class option
|
class option
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
// Public data
|
|
||||||
|
|
||||||
//- Enumeration for selection mode types
|
|
||||||
enum selectionModeType
|
|
||||||
{
|
|
||||||
smPoints,
|
|
||||||
smCellSet,
|
|
||||||
smCellZone,
|
|
||||||
smMapRegion,
|
|
||||||
smAll
|
|
||||||
};
|
|
||||||
|
|
||||||
//- Word list of selection mode type names
|
|
||||||
static const NamedEnum<selectionModeType, 5>
|
|
||||||
selectionModeTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
@ -111,39 +86,6 @@ protected:
|
|||||||
//- Source active flag
|
//- Source active flag
|
||||||
bool active_;
|
bool active_;
|
||||||
|
|
||||||
//- Time start
|
|
||||||
scalar timeStart_;
|
|
||||||
|
|
||||||
//- Duration
|
|
||||||
scalar duration_;
|
|
||||||
|
|
||||||
//- Cell selection mode
|
|
||||||
selectionModeType selectionMode_;
|
|
||||||
|
|
||||||
//- Name of cell set for "cellSet" and "cellZone" selectionMode
|
|
||||||
word cellSetName_;
|
|
||||||
|
|
||||||
//- List of points for "points" selectionMode
|
|
||||||
List<point> points_;
|
|
||||||
|
|
||||||
//- Set of cells to apply source to
|
|
||||||
labelList cells_;
|
|
||||||
|
|
||||||
//- Sum of cell volumes
|
|
||||||
scalar V_;
|
|
||||||
|
|
||||||
// Data for smMapRegion only
|
|
||||||
|
|
||||||
//- Mesh to mesh interpolation object
|
|
||||||
autoPtr<meshToMesh> meshInterpPtr_;
|
|
||||||
|
|
||||||
//- Name of the neighbour region to map
|
|
||||||
word nbrRegionName_;
|
|
||||||
|
|
||||||
//- Master or slave region
|
|
||||||
bool master_;
|
|
||||||
|
|
||||||
|
|
||||||
//- Field names to apply source to - populated by derived models
|
//- Field names to apply source to - populated by derived models
|
||||||
wordList fieldNames_;
|
wordList fieldNames_;
|
||||||
|
|
||||||
@ -156,12 +98,6 @@ protected:
|
|||||||
//- Flag to bypass the apply flag list checking
|
//- Flag to bypass the apply flag list checking
|
||||||
virtual bool alwaysApply() const;
|
virtual bool alwaysApply() const;
|
||||||
|
|
||||||
//- Set the cellSet or points selection
|
|
||||||
void setSelection(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Set the cell set based on the user input selection mode
|
|
||||||
void setCellSet();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -194,8 +130,7 @@ public:
|
|||||||
const word& name,
|
const word& name,
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh
|
||||||
const bool master = false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Return clone
|
//- Return clone
|
||||||
@ -209,8 +144,9 @@ public:
|
|||||||
// on the freestore from an Istream
|
// on the freestore from an Istream
|
||||||
class iNew
|
class iNew
|
||||||
{
|
{
|
||||||
//- Reference to the mesh database
|
//- Reference to the mesh
|
||||||
const fvMesh& mesh_;
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
const word& name_;
|
const word& name_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -253,7 +189,6 @@ public:
|
|||||||
virtual ~option();
|
virtual ~option();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
@ -270,34 +205,6 @@ public:
|
|||||||
//- Return const access to the source active flag
|
//- Return const access to the source active flag
|
||||||
inline bool active() const;
|
inline bool active() const;
|
||||||
|
|
||||||
//- Return const access to the time start
|
|
||||||
inline scalar timeStart() const;
|
|
||||||
|
|
||||||
//- Return const access to the duration
|
|
||||||
inline scalar duration() const;
|
|
||||||
|
|
||||||
//- Return true if within time limits
|
|
||||||
inline bool inTimeLimits(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return const access to the cell selection mode
|
|
||||||
inline const selectionModeType& selectionMode() const;
|
|
||||||
|
|
||||||
//- Return const access to the name of cell set for "cellSet"
|
|
||||||
// selectionMode
|
|
||||||
inline const word& cellSetName() const;
|
|
||||||
|
|
||||||
//- Return const access to the total cell volume
|
|
||||||
inline scalar V() const;
|
|
||||||
|
|
||||||
//- Return const access to the neighbour region name
|
|
||||||
inline const word& nbrRegionName() const;
|
|
||||||
|
|
||||||
//- Return const access to the mapToMap pointer
|
|
||||||
inline const meshToMesh& meshInterp() const;
|
|
||||||
|
|
||||||
//- Return const access to the cell set
|
|
||||||
inline const labelList& cells() const;
|
|
||||||
|
|
||||||
//- Set the applied flag to true for field index fieldI
|
//- Set the applied flag to true for field index fieldI
|
||||||
inline void setApplied(const label fieldI);
|
inline void setApplied(const label fieldI);
|
||||||
|
|
||||||
@ -307,12 +214,6 @@ public:
|
|||||||
//- Return access to the source active flag
|
//- Return access to the source active flag
|
||||||
inline bool& active();
|
inline bool& active();
|
||||||
|
|
||||||
//- Return access to the time start
|
|
||||||
inline scalar& timeStart();
|
|
||||||
|
|
||||||
//- Return access to the duration
|
|
||||||
inline scalar& duration();
|
|
||||||
|
|
||||||
|
|
||||||
// Checks
|
// Checks
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,8 +23,6 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline const Foam::word& Foam::fv::option::name() const
|
inline const Foam::word& Foam::fv::option::name() const
|
||||||
@ -51,57 +49,6 @@ inline bool Foam::fv::option::active() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::fv::option::timeStart() const
|
|
||||||
{
|
|
||||||
return timeStart_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::fv::option::duration() const
|
|
||||||
{
|
|
||||||
return duration_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::fv::option::inTimeLimits(const scalar time) const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(
|
|
||||||
(timeStart_ < 0)
|
|
||||||
||
|
|
||||||
(
|
|
||||||
(mesh_.time().value() >= timeStart_)
|
|
||||||
&& (mesh_.time().value() <= (timeStart_ + duration_))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::fv::option::selectionModeType&
|
|
||||||
Foam::fv::option::selectionMode() const
|
|
||||||
{
|
|
||||||
return selectionMode_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word& Foam::fv::option::cellSetName() const
|
|
||||||
{
|
|
||||||
return cellSetName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::fv::option::V() const
|
|
||||||
{
|
|
||||||
return V_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::labelList& Foam::fv::option::cells() const
|
|
||||||
{
|
|
||||||
return cells_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::fv::option::setApplied(const label fieldI)
|
inline void Foam::fv::option::setApplied(const label fieldI)
|
||||||
{
|
{
|
||||||
applied_[fieldI] = true;
|
applied_[fieldI] = true;
|
||||||
@ -114,35 +61,4 @@ inline bool& Foam::fv::option::active()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::fv::option::timeStart()
|
|
||||||
{
|
|
||||||
return timeStart_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::fv::option::duration()
|
|
||||||
{
|
|
||||||
return duration_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word& Foam::fv::option::nbrRegionName() const
|
|
||||||
{
|
|
||||||
return nbrRegionName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::meshToMesh& Foam::fv::option::meshInterp() const
|
|
||||||
{
|
|
||||||
if (!meshInterpPtr_.valid())
|
|
||||||
{
|
|
||||||
FatalErrorIn("const meshToMesh& meshInterp() const")
|
|
||||||
<< "Interpolation object not set"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return meshInterpPtr_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
58
src/fvOptions/fvOption/fvOptionIO.C
Normal file
58
src/fvOptions/fvOption/fvOptionIO.C
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "fvOption.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::option::writeHeader(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << indent << name_ << nl
|
||||||
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::writeFooter(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::option::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::option::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
dict.readIfPresent("active", active_);
|
||||||
|
coeffs_ = dict.subDict(modelType_ + "Coeffs");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -1,613 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2015 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 "fvOption.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "fvMatrices.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "fvsPatchFields.H"
|
|
||||||
#include "ListOps.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(option, 0);
|
|
||||||
defineRunTimeSelectionTable(option, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> const char* NamedEnum
|
|
||||||
<
|
|
||||||
fv::option::selectionModeType,
|
|
||||||
5
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"points",
|
|
||||||
"cellSet",
|
|
||||||
"cellZone",
|
|
||||||
"mapRegion",
|
|
||||||
"all"
|
|
||||||
};
|
|
||||||
|
|
||||||
const NamedEnum<fv::option::selectionModeType, 5>
|
|
||||||
fv::option::selectionModeTypeNames_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::fv::option::alwaysApply() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setSelection(const dictionary& dict)
|
|
||||||
{
|
|
||||||
switch (selectionMode_)
|
|
||||||
{
|
|
||||||
case smPoints:
|
|
||||||
{
|
|
||||||
dict.lookup("points") >> points_;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smCellSet:
|
|
||||||
{
|
|
||||||
dict.lookup("cellSet") >> cellSetName_;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smCellZone:
|
|
||||||
{
|
|
||||||
dict.lookup("cellZone") >> cellSetName_;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smMapRegion:
|
|
||||||
{
|
|
||||||
dict.lookup("nbrRegionName") >> nbrRegionName_;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smAll:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorIn("option::setSelection(const dictionary&)")
|
|
||||||
<< "Unknown selectionMode "
|
|
||||||
<< selectionModeTypeNames_[selectionMode_]
|
|
||||||
<< ". Valid selectionMode types are" << selectionModeTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setCellSet()
|
|
||||||
{
|
|
||||||
switch (selectionMode_)
|
|
||||||
{
|
|
||||||
case smPoints:
|
|
||||||
{
|
|
||||||
Info<< indent << "- selecting cells using points" << endl;
|
|
||||||
|
|
||||||
labelHashSet selectedCells;
|
|
||||||
|
|
||||||
forAll(points_, i)
|
|
||||||
{
|
|
||||||
label cellI = mesh_.findCell(points_[i]);
|
|
||||||
if (cellI >= 0)
|
|
||||||
{
|
|
||||||
selectedCells.insert(cellI);
|
|
||||||
}
|
|
||||||
|
|
||||||
label globalCellI = returnReduce(cellI, maxOp<label>());
|
|
||||||
if (globalCellI < 0)
|
|
||||||
{
|
|
||||||
WarningIn("option::setCellSet()")
|
|
||||||
<< "Unable to find owner cell for point " << points_[i]
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cells_ = selectedCells.toc();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smCellSet:
|
|
||||||
{
|
|
||||||
Info<< indent
|
|
||||||
<< "- selecting cells using cellSet " << cellSetName_ << endl;
|
|
||||||
|
|
||||||
cellSet selectedCells(mesh_, cellSetName_);
|
|
||||||
cells_ = selectedCells.toc();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smCellZone:
|
|
||||||
{
|
|
||||||
Info<< indent
|
|
||||||
<< "- selecting cells using cellZone " << cellSetName_ << endl;
|
|
||||||
|
|
||||||
label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
|
|
||||||
if (zoneID == -1)
|
|
||||||
{
|
|
||||||
FatalErrorIn("option::setCellIds()")
|
|
||||||
<< "Cannot find cellZone " << cellSetName_ << endl
|
|
||||||
<< "Valid cellZones are " << mesh_.cellZones().names()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
cells_ = mesh_.cellZones()[zoneID];
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smMapRegion:
|
|
||||||
{
|
|
||||||
if (active_ && master_)
|
|
||||||
{
|
|
||||||
Info<< indent << "- selecting inter region mapping" << endl;
|
|
||||||
|
|
||||||
const fvMesh& nbrMesh =
|
|
||||||
mesh_.time().lookupObject<fvMesh>(nbrRegionName_);
|
|
||||||
|
|
||||||
if (mesh_.name() == nbrMesh.name())
|
|
||||||
{
|
|
||||||
FatalErrorIn("option::setCellIds()")
|
|
||||||
<< "Inter-region model selected, but local and "
|
|
||||||
<< "neighbour regions are the same: " << nl
|
|
||||||
<< " local region: " << mesh_.name() << nl
|
|
||||||
<< " secondary region: " << nbrMesh.name() << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh_.bounds().overlaps(nbrMesh.bounds()))
|
|
||||||
{
|
|
||||||
meshInterpPtr_.reset
|
|
||||||
(
|
|
||||||
new meshToMesh
|
|
||||||
(
|
|
||||||
mesh_,
|
|
||||||
nbrMesh,
|
|
||||||
meshToMesh::interpolationMethodNames_.read
|
|
||||||
(
|
|
||||||
dict_.lookup("interpolationMethod")
|
|
||||||
),
|
|
||||||
false // not interpolating patches
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn("option::setCellSet()")
|
|
||||||
<< "regions " << mesh_.name() << " and "
|
|
||||||
<< nbrMesh.name() << " do not intersect"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
V_ = meshInterpPtr_->V();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case smAll:
|
|
||||||
{
|
|
||||||
Info<< indent << "- selecting all cells" << endl;
|
|
||||||
cells_ = identity(mesh_.nCells());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorIn("option::setCellSet()")
|
|
||||||
<< "Unknown selectionMode "
|
|
||||||
<< selectionModeTypeNames_[selectionMode_]
|
|
||||||
<< ". Valid selectionMode types are" << selectionModeTypeNames_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set volume information
|
|
||||||
if (selectionMode_ != smMapRegion)
|
|
||||||
{
|
|
||||||
V_ = 0.0;
|
|
||||||
forAll(cells_, i)
|
|
||||||
{
|
|
||||||
V_ += mesh_.V()[cells_[i]];
|
|
||||||
}
|
|
||||||
reduce(V_, sumOp<scalar>());
|
|
||||||
|
|
||||||
Info<< indent
|
|
||||||
<< "- selected " << returnReduce(cells_.size(), sumOp<label>())
|
|
||||||
<< " cell(s) with volume " << V_ << nl << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fv::option::option
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& modelType,
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const bool master
|
|
||||||
)
|
|
||||||
:
|
|
||||||
name_(name),
|
|
||||||
modelType_(modelType),
|
|
||||||
mesh_(mesh),
|
|
||||||
dict_(dict),
|
|
||||||
coeffs_(dict.subDict(modelType + "Coeffs")),
|
|
||||||
active_(readBool(dict_.lookup("active"))),
|
|
||||||
timeStart_(-1.0),
|
|
||||||
duration_(0.0),
|
|
||||||
selectionMode_(selectionModeTypeNames_.read(dict_.lookup("selectionMode"))),
|
|
||||||
cellSetName_("none"),
|
|
||||||
V_(0.0),
|
|
||||||
meshInterpPtr_(),
|
|
||||||
nbrRegionName_("none"),
|
|
||||||
master_(master),
|
|
||||||
fieldNames_(),
|
|
||||||
applied_()
|
|
||||||
{
|
|
||||||
Info<< incrIndent << indent << "Source: " << name_ << endl;
|
|
||||||
|
|
||||||
if (dict_.readIfPresent("timeStart", timeStart_))
|
|
||||||
{
|
|
||||||
dict_.lookup("duration") >> duration_;
|
|
||||||
Info<< indent << "- applying source at time " << timeStart_
|
|
||||||
<< " for duration " << duration_ << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< indent << "- applying source for all time" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
setSelection(dict_);
|
|
||||||
|
|
||||||
setCellSet();
|
|
||||||
|
|
||||||
Info<< decrIndent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const dictionary& coeffs,
|
|
||||||
const fvMesh& mesh
|
|
||||||
)
|
|
||||||
{
|
|
||||||
word modelType(coeffs.lookup("type"));
|
|
||||||
|
|
||||||
Info<< indent
|
|
||||||
<< "Selecting finite volume options model type " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"option::New(const word&, const dictionary&, const fvMesh&)"
|
|
||||||
) << "Unknown Model type " << modelType << nl << nl
|
|
||||||
<< "Valid model types are:" << nl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::fv::option::~option()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::fv::option::isActive()
|
|
||||||
{
|
|
||||||
if (active_ && inTimeLimits(mesh_.time().value()))
|
|
||||||
{
|
|
||||||
// Update the cell set if the mesh is changing
|
|
||||||
if (mesh_.changing())
|
|
||||||
{
|
|
||||||
setCellSet();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::fv::option::applyToField(const word& fieldName) const
|
|
||||||
{
|
|
||||||
if (alwaysApply())
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return findIndex(fieldNames_, fieldName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::checkApplied() const
|
|
||||||
{
|
|
||||||
forAll(applied_, i)
|
|
||||||
{
|
|
||||||
if (!applied_[i])
|
|
||||||
{
|
|
||||||
WarningIn("void option::checkApplied() const")
|
|
||||||
<< "Source " << name_ << " defined for field "
|
|
||||||
<< fieldNames_[i] << " but never used" << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::correct(volScalarField& fld)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::correct(volVectorField& fld)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::correct(volSphericalTensorField& fld)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::correct(volSymmTensorField& fld)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::correct(volTensorField& fld)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<vector>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<sphericalTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<symmTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
fvMatrix<tensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<vector>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<sphericalTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<symmTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<tensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<scalar>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addSup(alpha*rho, eqn, fieldI);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<vector>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addSup(alpha*rho, eqn, fieldI);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<sphericalTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addSup(alpha*rho, eqn, fieldI);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<symmTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addSup(alpha*rho, eqn, fieldI);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::addSup
|
|
||||||
(
|
|
||||||
const volScalarField& alpha,
|
|
||||||
const volScalarField& rho,
|
|
||||||
fvMatrix<tensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addSup(alpha*rho, eqn, fieldI);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setValue(fvMatrix<scalar>& eqn, const label fieldI)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setValue(fvMatrix<vector>& eqn, const label fieldI)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setValue
|
|
||||||
(
|
|
||||||
fvMatrix<sphericalTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setValue
|
|
||||||
(
|
|
||||||
fvMatrix<symmTensor>& eqn,
|
|
||||||
const label fieldI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::option::setValue(fvMatrix<tensor>& eqn, const label fieldI)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
121
src/fvOptions/interRegionOption/interRegionOption.C
Normal file
121
src/fvOptions/interRegionOption/interRegionOption.C
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "interRegionOption.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(interRegionOption, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected member functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionOption::setMapper()
|
||||||
|
{
|
||||||
|
if (master_)
|
||||||
|
{
|
||||||
|
Info<< indent << "- selecting inter region mapping" << endl;
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh =
|
||||||
|
mesh_.time().lookupObject<fvMesh>(nbrRegionName_);
|
||||||
|
|
||||||
|
if (mesh_.name() == nbrMesh.name())
|
||||||
|
{
|
||||||
|
FatalErrorIn("interRegionOption::setCellIds()")
|
||||||
|
<< "Inter-region model selected, but local and "
|
||||||
|
<< "neighbour regions are the same: " << nl
|
||||||
|
<< " local region: " << mesh_.name() << nl
|
||||||
|
<< " secondary region: " << nbrMesh.name() << nl
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mesh_.bounds().overlaps(nbrMesh.bounds()))
|
||||||
|
{
|
||||||
|
meshInterpPtr_.reset
|
||||||
|
(
|
||||||
|
new meshToMesh
|
||||||
|
(
|
||||||
|
mesh_,
|
||||||
|
nbrMesh,
|
||||||
|
meshToMesh::interpolationMethodNames_.read
|
||||||
|
(
|
||||||
|
coeffs_.lookup("interpolationMethod")
|
||||||
|
),
|
||||||
|
false // not interpolating patches
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("interRegionOption::setCellSet()")
|
||||||
|
<< "regions " << mesh_.name() << " and "
|
||||||
|
<< nbrMesh.name() << " do not intersect"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::interRegionOption::interRegionOption
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
modelType,
|
||||||
|
dict,
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
master_(coeffs_.lookupOrDefault<bool>("master", true)),
|
||||||
|
nbrRegionName_(coeffs_.lookup("nbrRegionName")),
|
||||||
|
meshInterpPtr_()
|
||||||
|
{
|
||||||
|
if (active())
|
||||||
|
{
|
||||||
|
setMapper();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::interRegionOption::~interRegionOption()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
132
src/fvOptions/interRegionOption/interRegionOption.H
Normal file
132
src/fvOptions/interRegionOption/interRegionOption.H
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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::interRegionOption
|
||||||
|
|
||||||
|
Description
|
||||||
|
Base class for inter region exchange.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef interRegionOption_H
|
||||||
|
#define interRegionOption_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "meshToMesh.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class interRegionOption Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class interRegionOption
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Master or slave region
|
||||||
|
bool master_;
|
||||||
|
|
||||||
|
//- Name of the neighbour region to map
|
||||||
|
word nbrRegionName_;
|
||||||
|
|
||||||
|
//- Mesh to mesh interpolation object
|
||||||
|
autoPtr<meshToMesh> meshInterpPtr_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected member functions
|
||||||
|
|
||||||
|
//- Set the mesh to mesh interpolation object
|
||||||
|
void setMapper();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("interRegionOption");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
interRegionOption
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~interRegionOption();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the neighbour region name
|
||||||
|
inline const word& nbrRegionName() const;
|
||||||
|
|
||||||
|
//- Return const access to the mapToMap pointer
|
||||||
|
inline const meshToMesh& meshInterp() const;
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write data
|
||||||
|
virtual void writeData(Ostream&) const;
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "interRegionOptionI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
52
src/fvOptions/interRegionOption/interRegionOptionI.H
Normal file
52
src/fvOptions/interRegionOption/interRegionOptionI.H
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012-2015 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline const Foam::word&
|
||||||
|
Foam::fv::interRegionOption::nbrRegionName() const
|
||||||
|
{
|
||||||
|
return nbrRegionName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::meshToMesh&
|
||||||
|
Foam::fv::interRegionOption::meshInterp() const
|
||||||
|
{
|
||||||
|
if (!meshInterpPtr_.valid())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"const meshToMesh& interRegionOption::meshInterp() const"
|
||||||
|
) << "Interpolation object not set"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return meshInterpPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
52
src/fvOptions/interRegionOption/interRegionOptionIO.C
Normal file
52
src/fvOptions/interRegionOption/interRegionOptionIO.C
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "interRegionOption.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionOption::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
option::writeData(os);
|
||||||
|
os.writeKeyword("master") << master_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("nbrRegionName") << nbrRegionName_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::interRegionOption::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -87,7 +87,7 @@ Foam::fv::actuationDiskSource::actuationDiskSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
diskDir_(coeffs_.lookup("diskDir")),
|
diskDir_(coeffs_.lookup("diskDir")),
|
||||||
Cp_(readScalar(coeffs_.lookup("Cp"))),
|
Cp_(readScalar(coeffs_.lookup("Cp"))),
|
||||||
Ct_(readScalar(coeffs_.lookup("Ct"))),
|
Ct_(readScalar(coeffs_.lookup("Ct"))),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,7 +69,7 @@ SourceFiles
|
|||||||
#ifndef actuationDiskSource_H
|
#ifndef actuationDiskSource_H
|
||||||
#define actuationDiskSource_H
|
#define actuationDiskSource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ namespace fv
|
|||||||
|
|
||||||
class actuationDiskSource
|
class actuationDiskSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -151,7 +151,7 @@ Foam::fv::effectivenessHeatExchangerSource::effectivenessHeatExchangerSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
secondaryMassFlowRate_(readScalar(coeffs_.lookup("secondaryMassFlowRate"))),
|
secondaryMassFlowRate_(readScalar(coeffs_.lookup("secondaryMassFlowRate"))),
|
||||||
secondaryInletT_(readScalar(coeffs_.lookup("secondaryInletT"))),
|
secondaryInletT_(readScalar(coeffs_.lookup("secondaryInletT"))),
|
||||||
primaryInletT_(readScalar(coeffs_.lookup("primaryInletT"))),
|
primaryInletT_(readScalar(coeffs_.lookup("primaryInletT"))),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,12 +66,13 @@ Description
|
|||||||
effectivenessHeatExchangerSource1
|
effectivenessHeatExchangerSource1
|
||||||
{
|
{
|
||||||
type effectivenessHeatExchangerSource;
|
type effectivenessHeatExchangerSource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
effectivenessHeatExchangerSourceCoeffs
|
effectivenessHeatExchangerSourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
secondaryMassFlowRate 1.0;
|
secondaryMassFlowRate 1.0;
|
||||||
secondaryInletT 336;
|
secondaryInletT 336;
|
||||||
primaryInletT 293;
|
primaryInletT 293;
|
||||||
@ -133,7 +134,7 @@ SourceFiles
|
|||||||
#ifndef effectivenessHeatExchangerSource_H
|
#ifndef effectivenessHeatExchangerSource_H
|
||||||
#define effectivenessHeatExchangerSource_H
|
#define effectivenessHeatExchangerSource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "interpolation2DTable.H"
|
#include "interpolation2DTable.H"
|
||||||
|
|
||||||
@ -150,7 +151,7 @@ namespace fv
|
|||||||
|
|
||||||
class effectivenessHeatExchangerSource
|
class effectivenessHeatExchangerSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ Foam::fv::explicitPorositySource::explicitPorositySource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
porosityPtr_(NULL)
|
porosityPtr_(NULL)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
|
|||||||
@ -66,7 +66,7 @@ SourceFiles
|
|||||||
#ifndef explicitPorositySource_H
|
#ifndef explicitPorositySource_H
|
||||||
#define explicitPorositySource_H
|
#define explicitPorositySource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ namespace fv
|
|||||||
|
|
||||||
class explicitPorositySource
|
class explicitPorositySource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,7 +85,7 @@ Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(sourceName, modelType, dict, mesh),
|
cellSetOption(sourceName, modelType, dict, mesh),
|
||||||
Ubar_(coeffs_.lookup("Ubar")),
|
Ubar_(coeffs_.lookup("Ubar")),
|
||||||
gradP0_(0.0),
|
gradP0_(0.0),
|
||||||
dGradP_(0.0),
|
dGradP_(0.0),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -55,7 +55,7 @@ SourceFiles
|
|||||||
#include "cellSet.H"
|
#include "cellSet.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ namespace fv
|
|||||||
|
|
||||||
class pressureGradientExplicitSource
|
class pressureGradientExplicitSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -478,7 +478,7 @@ Foam::fv::rotorDiskSource::rotorDiskSource
|
|||||||
|
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
rhoRef_(1.0),
|
rhoRef_(1.0),
|
||||||
omega_(0.0),
|
omega_(0.0),
|
||||||
nBlades_(0),
|
nBlades_(0),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -88,7 +88,7 @@ SourceFiles
|
|||||||
#ifndef rotorDiskSource_H
|
#ifndef rotorDiskSource_H
|
||||||
#define rotorDiskSource_H
|
#define rotorDiskSource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "cylindricalCS.H"
|
#include "cylindricalCS.H"
|
||||||
#include "localAxesRotation.H"
|
#include "localAxesRotation.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
@ -113,7 +113,7 @@ namespace fv
|
|||||||
|
|
||||||
class rotorDiskSource
|
class rotorDiskSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "rotorDiskSource.H"
|
#include "rotorDiskSource.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
|
||||||
using namespace Foam::constant;
|
using namespace Foam::constant;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -235,7 +235,7 @@ Foam::fv::solidificationMeltingSource::solidificationMeltingSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(sourceName, modelType, dict, mesh),
|
cellSetOption(sourceName, modelType, dict, mesh),
|
||||||
Tmelt_(readScalar(coeffs_.lookup("Tmelt"))),
|
Tmelt_(readScalar(coeffs_.lookup("Tmelt"))),
|
||||||
L_(readScalar(coeffs_.lookup("L"))),
|
L_(readScalar(coeffs_.lookup("L"))),
|
||||||
relax_(coeffs_.lookupOrDefault("relax", 0.9)),
|
relax_(coeffs_.lookupOrDefault("relax", 0.9)),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,12 +51,13 @@ Description
|
|||||||
solidificationMeltingSource1
|
solidificationMeltingSource1
|
||||||
{
|
{
|
||||||
type solidificationMeltingSource;
|
type solidificationMeltingSource;
|
||||||
active on;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone iceZone;
|
|
||||||
|
|
||||||
solidificationMeltingSourceCoeffs
|
solidificationMeltingSourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone iceZone;
|
||||||
|
|
||||||
Tmelt 273;
|
Tmelt 273;
|
||||||
L 334000;
|
L 334000;
|
||||||
thermoMode thermo;
|
thermoMode thermo;
|
||||||
@ -96,7 +97,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -112,7 +113,7 @@ namespace fv
|
|||||||
|
|
||||||
class solidificationMeltingSource
|
class solidificationMeltingSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -34,8 +34,7 @@ Description
|
|||||||
SBM
|
SBM
|
||||||
{
|
{
|
||||||
type tabulatedAccelerationSource;
|
type tabulatedAccelerationSource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode all;
|
|
||||||
|
|
||||||
tabulatedAccelerationSourceCoeffs
|
tabulatedAccelerationSourceCoeffs
|
||||||
{
|
{
|
||||||
@ -55,6 +54,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "fvOption.H"
|
#include "fvOption.H"
|
||||||
#include "tabulated6DoFAcceleration.H"
|
#include "tabulated6DoFAcceleration.H"
|
||||||
|
#include "dimensionedTypes.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -119,7 +119,7 @@ Foam::fv::CodedSource<Type>::CodedSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh)
|
cellSetOption(name, modelType, dict, mesh)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,11 +58,12 @@ Description
|
|||||||
{
|
{
|
||||||
type scalarCodedSource;
|
type scalarCodedSource;
|
||||||
|
|
||||||
active true;
|
active yes;
|
||||||
selectionMode all;
|
|
||||||
|
|
||||||
scalarCodedSourceCoeffs
|
scalarCodedSourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode all;
|
||||||
|
|
||||||
fieldNames (h);
|
fieldNames (h);
|
||||||
redirectType sourceTime;
|
redirectType sourceTime;
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ SourceFiles
|
|||||||
#ifndef CodedSource_H
|
#ifndef CodedSource_H
|
||||||
#define CodedSource_H
|
#define CodedSource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "codedBase.H"
|
#include "codedBase.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -132,7 +133,7 @@ namespace fv
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class CodedSource
|
class CodedSource
|
||||||
:
|
:
|
||||||
public option,
|
public cellSetOption,
|
||||||
public codedBase
|
public codedBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -119,7 +119,7 @@ Foam::fv::SemiImplicitSource<Type>::SemiImplicitSource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
cellSetOption(name, modelType, dict, mesh),
|
||||||
volumeMode_(vmAbsolute),
|
volumeMode_(vmAbsolute),
|
||||||
VDash_(1.0),
|
VDash_(1.0),
|
||||||
injectionRate_()
|
injectionRate_()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,7 +69,7 @@ SourceFiles
|
|||||||
#define SemiImplicitSource_H
|
#define SemiImplicitSource_H
|
||||||
|
|
||||||
#include "Tuple2.H"
|
#include "Tuple2.H"
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ Ostream& operator<<
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class SemiImplicitSource
|
class SemiImplicitSource
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -118,7 +118,7 @@ Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh, true),
|
interRegionOption(name, modelType, dict, mesh),
|
||||||
porosityPtr_(NULL),
|
porosityPtr_(NULL),
|
||||||
firstIter_(-1),
|
firstIter_(-1),
|
||||||
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
|
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ SourceFiles
|
|||||||
#ifndef interRegionExplicitPorositySource_H
|
#ifndef interRegionExplicitPorositySource_H
|
||||||
#define interRegionExplicitPorositySource_H
|
#define interRegionExplicitPorositySource_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "interRegionOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ namespace fv
|
|||||||
|
|
||||||
class interRegionExplicitPorositySource
|
class interRegionExplicitPorositySource
|
||||||
:
|
:
|
||||||
public option
|
public interRegionOption
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -79,7 +79,7 @@ void Foam::fv::interRegionHeatTransferModel::setNbrModel()
|
|||||||
|
|
||||||
firstIter_ = false;
|
firstIter_ = false;
|
||||||
|
|
||||||
// set nbr model's nbr model to avoid construction order problems
|
// Set nbr model's nbr model to avoid construction order problems
|
||||||
nbrModel_->setNbrModel();
|
nbrModel_->setNbrModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,9 +112,15 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh, readBool(dict.lookup("master"))),
|
interRegionOption
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
modelType,
|
||||||
|
dict,
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
nbrModelName_(coeffs_.lookup("nbrModelName")),
|
||||||
nbrModel_(NULL),
|
nbrModel_(NULL),
|
||||||
nbrModelName_(word::null),
|
|
||||||
firstIter_(true),
|
firstIter_(true),
|
||||||
timeIndex_(-1),
|
timeIndex_(-1),
|
||||||
htc_
|
htc_
|
||||||
@ -142,8 +148,6 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
|||||||
{
|
{
|
||||||
if (active())
|
if (active())
|
||||||
{
|
{
|
||||||
coeffs_.lookup("nbrModelName") >> nbrModelName_;
|
|
||||||
|
|
||||||
coeffs_.lookup("fieldNames") >> fieldNames_;
|
coeffs_.lookup("fieldNames") >> fieldNames_;
|
||||||
applied_.setSize(fieldNames_.size(), false);
|
applied_.setSize(fieldNames_.size(), false);
|
||||||
|
|
||||||
@ -274,36 +278,4 @@ void Foam::fv::interRegionHeatTransferModel::addSup
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::writeData(Ostream& os) const
|
|
||||||
{
|
|
||||||
os.writeKeyword("name") << this->name() << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("nbrRegionName") << nbrRegionName_
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("nbrModelName") << nbrModelName_
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("master") << master_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("semiImplicit") << semiImplicit_ << token::END_STATEMENT
|
|
||||||
<< nl;
|
|
||||||
|
|
||||||
if (dict_.found("note"))
|
|
||||||
{
|
|
||||||
os.writeKeyword("note") << string(dict_.lookup("note"))
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::fv::interRegionHeatTransferModel::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (option::read(dict))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,10 +38,9 @@ Description
|
|||||||
#ifndef interRegionHeatTransferModel_H
|
#ifndef interRegionHeatTransferModel_H
|
||||||
#define interRegionHeatTransferModel_H
|
#define interRegionHeatTransferModel_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "interRegionOption.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -55,30 +54,24 @@ namespace fv
|
|||||||
|
|
||||||
class interRegionHeatTransferModel
|
class interRegionHeatTransferModel
|
||||||
:
|
:
|
||||||
public option
|
public interRegionOption
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
private:
|
// Protected data
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Pointer to neighbour interRegionHeatTransferModel
|
|
||||||
interRegionHeatTransferModel* nbrModel_;
|
|
||||||
|
|
||||||
//- Name of the model in the neighbour mesh
|
//- Name of the model in the neighbour mesh
|
||||||
word nbrModelName_;
|
word nbrModelName_;
|
||||||
|
|
||||||
|
//- Pointer to neighbour interRegionHeatTransferModel
|
||||||
|
interRegionHeatTransferModel* nbrModel_;
|
||||||
|
|
||||||
//- First iteration
|
//- First iteration
|
||||||
bool firstIter_;
|
bool firstIter_;
|
||||||
|
|
||||||
//- Time index - used for updating htc
|
//- Time index - used for updating htc
|
||||||
label timeIndex_;
|
label timeIndex_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Heat transfer coefficient [W/m2/k] times area/volume [1/m]
|
//- Heat transfer coefficient [W/m2/k] times area/volume [1/m]
|
||||||
volScalarField htc_;
|
volScalarField htc_;
|
||||||
|
|
||||||
@ -159,6 +152,12 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the neighbour region name
|
||||||
|
inline const word& nbrRegionName() const;
|
||||||
|
|
||||||
|
//- Return const access to the mapToMap pointer
|
||||||
|
inline const meshToMesh& meshInterp() const;
|
||||||
|
|
||||||
//- Return the heat transfer coefficient
|
//- Return the heat transfer coefficient
|
||||||
inline const volScalarField& htc() const;
|
inline const volScalarField& htc() const;
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,9 +23,31 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline const Foam::word&
|
||||||
|
Foam::fv::interRegionHeatTransferModel::nbrRegionName() const
|
||||||
|
{
|
||||||
|
return nbrRegionName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::meshToMesh&
|
||||||
|
Foam::fv::interRegionHeatTransferModel::meshInterp() const
|
||||||
|
{
|
||||||
|
if (!meshInterpPtr_.valid())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"const meshToMesh& interRegionHeatTransferModel::meshInterp() const"
|
||||||
|
) << "Interpolation object not set"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return meshInterpPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField&
|
inline const Foam::volScalarField&
|
||||||
Foam::fv::interRegionHeatTransferModel::htc() const
|
Foam::fv::interRegionHeatTransferModel::htc() const
|
||||||
{
|
{
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2015 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 "interRegionHeatTransferModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransferModel::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
interRegionOption::writeData(os);
|
||||||
|
|
||||||
|
os.writeKeyword("nbrModelName") << nbrModelName_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("semiImplicit") << semiImplicit_ << token::END_STATEMENT
|
||||||
|
<< nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::interRegionHeatTransferModel::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 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 |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -20,24 +20,28 @@ FoamFile
|
|||||||
front
|
front
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 700;
|
nFaces 700;
|
||||||
startFace 63400;
|
startFace 63400;
|
||||||
}
|
}
|
||||||
back
|
back
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 700;
|
nFaces 700;
|
||||||
startFace 64100;
|
startFace 64100;
|
||||||
}
|
}
|
||||||
wall
|
walls
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 1400;
|
nFaces 1400;
|
||||||
startFace 64800;
|
startFace 64800;
|
||||||
}
|
}
|
||||||
porosityWall
|
porosityWall
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 1600;
|
nFaces 1600;
|
||||||
startFace 66200;
|
startFace 66200;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,11 +19,12 @@ porosity1
|
|||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active yes;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone stator;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone stator;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -20,24 +20,28 @@ FoamFile
|
|||||||
rotor
|
rotor
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 192;
|
nFaces 192;
|
||||||
startFace 5952;
|
startFace 5952;
|
||||||
}
|
}
|
||||||
stator
|
stator
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
nFaces 192;
|
nFaces 192;
|
||||||
startFace 6144;
|
startFace 6144;
|
||||||
}
|
}
|
||||||
front
|
front
|
||||||
{
|
{
|
||||||
type empty;
|
type empty;
|
||||||
|
inGroups 1(empty);
|
||||||
nFaces 3072;
|
nFaces 3072;
|
||||||
startFace 6336;
|
startFace 6336;
|
||||||
}
|
}
|
||||||
back
|
back
|
||||||
{
|
{
|
||||||
type empty;
|
type empty;
|
||||||
|
inGroups 1(empty);
|
||||||
nFaces 3072;
|
nFaces 3072;
|
||||||
startFace 9408;
|
startFace 9408;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
source1
|
source1
|
||||||
{
|
{
|
||||||
type fixedTemperatureConstraint;
|
type fixedTemperatureConstraint;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
fixedTemperatureConstraintCoeffs
|
fixedTemperatureConstraintCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
mode uniform;
|
mode uniform;
|
||||||
temperature 350;
|
temperature 350;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format binary;
|
||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
location "constant/polyMesh";
|
location "constant/polyMesh";
|
||||||
object boundary;
|
object boundary;
|
||||||
|
|||||||
@ -18,12 +18,12 @@ FoamFile
|
|||||||
fixedTemperaure1
|
fixedTemperaure1
|
||||||
{
|
{
|
||||||
type fixedTemperatureConstraint;
|
type fixedTemperatureConstraint;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
fixedTemperatureConstraintCoeffs
|
fixedTemperatureConstraintCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
mode uniform;
|
mode uniform;
|
||||||
temperature 350;
|
temperature 350;
|
||||||
}
|
}
|
||||||
@ -33,12 +33,12 @@ fixedTemperaure1
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
type fixedCoeff;
|
type fixedCoeff;
|
||||||
active yes;
|
active yes;
|
||||||
cellZone porosity;
|
cellZone porosity;
|
||||||
|
|||||||
@ -18,14 +18,14 @@ FoamFile
|
|||||||
airToporous
|
airToporous
|
||||||
{
|
{
|
||||||
type constantHeatTransfer;
|
type constantHeatTransfer;
|
||||||
active on;
|
active yes;
|
||||||
selectionMode mapRegion;
|
|
||||||
|
constantHeatTransferCoeffs
|
||||||
|
{
|
||||||
interpolationMethod cellVolumeWeight;
|
interpolationMethod cellVolumeWeight;
|
||||||
nbrRegionName porous;
|
nbrRegionName porous;
|
||||||
master false;
|
master false;
|
||||||
|
|
||||||
constantHeatTransferCoeffs
|
|
||||||
{
|
|
||||||
nbrModelName porousToair;
|
nbrModelName porousToair;
|
||||||
fieldNames (h);
|
fieldNames (h);
|
||||||
semiImplicit no;
|
semiImplicit no;
|
||||||
@ -35,13 +35,13 @@ airToporous
|
|||||||
porosityBlockage
|
porosityBlockage
|
||||||
{
|
{
|
||||||
type interRegionExplicitPorositySource;
|
type interRegionExplicitPorositySource;
|
||||||
active on;
|
active yes;
|
||||||
selectionMode mapRegion;
|
|
||||||
interpolationMethod cellVolumeWeight;
|
|
||||||
nbrRegionName porous;
|
|
||||||
|
|
||||||
interRegionExplicitPorositySourceCoeffs
|
interRegionExplicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
interpolationMethod cellVolumeWeight;
|
||||||
|
nbrRegionName porous;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -18,18 +18,19 @@ FoamFile
|
|||||||
porousToair
|
porousToair
|
||||||
{
|
{
|
||||||
type constantHeatTransfer;
|
type constantHeatTransfer;
|
||||||
active on;
|
active yes;
|
||||||
selectionMode mapRegion;
|
|
||||||
|
constantHeatTransferCoeffs
|
||||||
|
{
|
||||||
interpolationMethod cellVolumeWeight;
|
interpolationMethod cellVolumeWeight;
|
||||||
nbrRegionName air;
|
nbrRegionName air;
|
||||||
master true;
|
master true;
|
||||||
|
|
||||||
constantHeatTransferCoeffs
|
|
||||||
{
|
|
||||||
nbrModelName airToporous;
|
nbrModelName airToporous;
|
||||||
fieldNames (h);
|
fieldNames (h);
|
||||||
semiImplicit no;
|
semiImplicit no;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -18,13 +18,14 @@ FoamFile
|
|||||||
momentumSource
|
momentumSource
|
||||||
{
|
{
|
||||||
type pressureGradientExplicitSource;
|
type pressureGradientExplicitSource;
|
||||||
active on; //on/off switch
|
active yes;
|
||||||
selectionMode all; //cellSet // points //cellZone
|
|
||||||
|
|
||||||
pressureGradientExplicitSourceCoeffs
|
pressureGradientExplicitSourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode all;
|
||||||
|
|
||||||
fieldNames (U);
|
fieldNames (U);
|
||||||
Ubar ( 0.1335 0 0 );
|
Ubar (0.1335 0 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,17 +18,18 @@ FoamFile
|
|||||||
disk1
|
disk1
|
||||||
{
|
{
|
||||||
type actuationDiskSource;
|
type actuationDiskSource;
|
||||||
active on; //on/off switch
|
active on;
|
||||||
selectionMode cellSet; //cellSet // points //cellZone
|
|
||||||
cellSet actuationDisk1;//cellSet name when selectionMode = cellSet
|
|
||||||
|
|
||||||
actuationDiskSourceCoeffs
|
actuationDiskSourceCoeffs
|
||||||
{
|
{
|
||||||
fieldNames (U);
|
fieldNames (U);
|
||||||
diskDir (1 0 0); // orientation of the disk
|
|
||||||
Cp 0.386; // Cp
|
selectionMode cellSet;
|
||||||
Ct 0.58; // Ct
|
cellSet actuationDisk1;
|
||||||
diskArea 40; // disk area
|
diskDir (1 0 0); // Orientation of the disk
|
||||||
|
Cp 0.386;
|
||||||
|
Ct 0.58;
|
||||||
|
diskArea 40;
|
||||||
upstreamPoint (581849 4785810 1065);
|
upstreamPoint (581849 4785810 1065);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,13 +38,14 @@ disk2
|
|||||||
{
|
{
|
||||||
type actuationDiskSource;
|
type actuationDiskSource;
|
||||||
active on;
|
active on;
|
||||||
selectionMode cellSet;
|
|
||||||
cellSet actuationDisk2;
|
|
||||||
|
|
||||||
actuationDiskSourceCoeffs
|
actuationDiskSourceCoeffs
|
||||||
{
|
{
|
||||||
fieldNames (U);
|
fieldNames (U);
|
||||||
diskDir (1 0 0);
|
|
||||||
|
selectionMode cellSet;
|
||||||
|
cellSet actuationDisk2;
|
||||||
|
diskDir (1 0 0); // Orientation of the disk
|
||||||
Cp 0.53;
|
Cp 0.53;
|
||||||
Ct 0.58;
|
Ct 0.58;
|
||||||
diskArea 40;
|
diskArea 40;
|
||||||
@ -51,4 +53,5 @@ disk2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -18,14 +18,15 @@ FoamFile
|
|||||||
source1
|
source1
|
||||||
{
|
{
|
||||||
type fixedTemperatureConstraint;
|
type fixedTemperatureConstraint;
|
||||||
active true;
|
active yes;
|
||||||
|
|
||||||
|
fixedTemperatureConstraintCoeffs
|
||||||
|
{
|
||||||
timeStart 0.1;
|
timeStart 0.1;
|
||||||
duration 0.4;
|
duration 0.4;
|
||||||
selectionMode cellSet;
|
selectionMode cellSet;
|
||||||
cellSet ignitionCells;
|
cellSet ignitionCells;
|
||||||
|
|
||||||
fixedTemperatureConstraintCoeffs
|
|
||||||
{
|
|
||||||
mode uniform;
|
mode uniform;
|
||||||
temperature 2000;
|
temperature 2000;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
filter1
|
filter1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
selectionMode cellZone;
|
active yes;
|
||||||
cellZone filter;
|
|
||||||
active true;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone filter;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
@ -50,7 +51,10 @@ filter1
|
|||||||
massSource1
|
massSource1
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type scalarSemiImplicitSource;
|
||||||
active true;
|
active yes;
|
||||||
|
|
||||||
|
scalarSemiImplicitSourceCoeffs
|
||||||
|
{
|
||||||
timeStart 0.2;
|
timeStart 0.2;
|
||||||
duration 2.0;
|
duration 2.0;
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
@ -59,8 +63,6 @@ massSource1
|
|||||||
(2.75 0.5 0)
|
(2.75 0.5 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
scalarSemiImplicitSourceCoeffs
|
|
||||||
{
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
@ -74,7 +76,10 @@ massSource1
|
|||||||
momentumSource1
|
momentumSource1
|
||||||
{
|
{
|
||||||
type vectorSemiImplicitSource;
|
type vectorSemiImplicitSource;
|
||||||
active true;
|
active yes;
|
||||||
|
|
||||||
|
vectorSemiImplicitSourceCoeffs
|
||||||
|
{
|
||||||
timeStart 0.2;
|
timeStart 0.2;
|
||||||
duration 2.0;
|
duration 2.0;
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
@ -83,8 +88,6 @@ momentumSource1
|
|||||||
(2.75 0.5 0)
|
(2.75 0.5 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
vectorSemiImplicitSourceCoeffs
|
|
||||||
{
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
@ -97,7 +100,10 @@ momentumSource1
|
|||||||
energySource1
|
energySource1
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type scalarSemiImplicitSource;
|
||||||
active true;
|
active yes;
|
||||||
|
|
||||||
|
scalarSemiImplicitSourceCoeffs
|
||||||
|
{
|
||||||
timeStart 0.2;
|
timeStart 0.2;
|
||||||
duration 2.0;
|
duration 2.0;
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
@ -106,8 +112,6 @@ energySource1
|
|||||||
(2.75 0.5 0)
|
(2.75 0.5 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
scalarSemiImplicitSourceCoeffs
|
|
||||||
{
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,12 +18,13 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type explicitPorositySource;
|
type explicitPorositySource;
|
||||||
active true;
|
active yes;
|
||||||
selectionMode cellZone;
|
|
||||||
cellZone porosity;
|
|
||||||
|
|
||||||
explicitPorositySourceCoeffs
|
explicitPorositySourceCoeffs
|
||||||
{
|
{
|
||||||
|
selectionMode cellZone;
|
||||||
|
cellZone porosity;
|
||||||
|
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
|
|
||||||
DarcyForchheimerCoeffs
|
DarcyForchheimerCoeffs
|
||||||
|
|||||||
@ -22,13 +22,8 @@ boundaryField
|
|||||||
{
|
{
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type totalPressure;
|
type prghPressure;
|
||||||
p0 $internalField;
|
p $internalField;
|
||||||
U U.air;
|
|
||||||
phi phi.air;
|
|
||||||
rho thermo:rho.air;
|
|
||||||
psi none;
|
|
||||||
gamma 1;
|
|
||||||
value $internalField;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
injector1
|
injector1
|
||||||
{
|
{
|
||||||
active true;
|
timeStart 0.1;
|
||||||
timeStart 0;
|
|
||||||
duration 5;
|
duration 5;
|
||||||
selectionMode points;
|
selectionMode points;
|
||||||
points
|
points
|
||||||
@ -32,10 +31,11 @@ options
|
|||||||
massSource1
|
massSource1
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type scalarSemiImplicitSource;
|
||||||
$injector1;
|
|
||||||
|
|
||||||
scalarSemiImplicitSourceCoeffs
|
scalarSemiImplicitSourceCoeffs
|
||||||
{
|
{
|
||||||
|
$injector1;
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
@ -47,10 +47,11 @@ options
|
|||||||
momentumSource1
|
momentumSource1
|
||||||
{
|
{
|
||||||
type vectorSemiImplicitSource;
|
type vectorSemiImplicitSource;
|
||||||
$injector1;
|
|
||||||
|
|
||||||
vectorSemiImplicitSourceCoeffs
|
vectorSemiImplicitSourceCoeffs
|
||||||
{
|
{
|
||||||
|
$injector1;
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
@ -62,10 +63,11 @@ options
|
|||||||
energySource1
|
energySource1
|
||||||
{
|
{
|
||||||
type scalarSemiImplicitSource;
|
type scalarSemiImplicitSource;
|
||||||
$injector1;
|
|
||||||
|
|
||||||
scalarSemiImplicitSourceCoeffs
|
scalarSemiImplicitSourceCoeffs
|
||||||
{
|
{
|
||||||
|
$injector1;
|
||||||
|
|
||||||
volumeMode absolute;
|
volumeMode absolute;
|
||||||
injectionRateSuSp
|
injectionRateSuSp
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user