mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -924,6 +924,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "addRegionOption.H"
|
||||
#include "addOverwriteOption.H"
|
||||
argList::addOption("dict", "name", "specify alternative dictionary");
|
||||
argList::addBoolOption("AMI", "apply mapped AMI boundary type");
|
||||
|
||||
#include "setRootCase.H"
|
||||
@ -932,6 +933,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const word dictName
|
||||
(args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
|
||||
|
||||
mappedPatchBase::sampleMode sampleMode = mappedPatchBase::NEARESTPATCHFACE;
|
||||
if (args.optionFound("AMI"))
|
||||
@ -943,7 +946,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"extrudeToRegionMeshDict",
|
||||
dictName,
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED
|
||||
|
||||
@ -43,6 +43,7 @@ Description
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Foam::timeSelector::addOptions();
|
||||
# include "addRegionOption.H"
|
||||
Foam::argList::addBoolOption
|
||||
(
|
||||
"noWrite",
|
||||
@ -74,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
# include "createNamedMesh.H"
|
||||
|
||||
utility().tryPreCalc(args, runTime, mesh);
|
||||
|
||||
|
||||
@ -37,6 +37,11 @@ Description
|
||||
|
||||
#include "calc.H"
|
||||
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "pointFields.H"
|
||||
#include "ReadFields.H"
|
||||
|
||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||
|
||||
#include "incompressible/RAS/RASModel/RASModel.H"
|
||||
@ -84,203 +89,268 @@ namespace Foam
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< " Reading p" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
if (args.optionFound("noFlow"))
|
||||
{
|
||||
IOobject RASPropertiesHeader
|
||||
(
|
||||
"RASProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
Info<< " Operating in no-flow mode; no models will be loaded."
|
||||
<< " All vol, surface and point fields will be loaded." << endl;
|
||||
|
||||
IOobject LESPropertiesHeader
|
||||
(
|
||||
"LESProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
// Read objects in time directory
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
if (RASPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary RASProperties(RASPropertiesHeader);
|
||||
// Read vol fields.
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
PtrList<volScalarField> vsFlds;
|
||||
ReadFields(mesh, objects, vsFlds);
|
||||
|
||||
autoPtr<incompressible::RASModel> RASModel
|
||||
(
|
||||
incompressible::RASModel::New
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
laminarTransport
|
||||
)
|
||||
);
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else if (LESPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary LESProperties(LESPropertiesHeader);
|
||||
PtrList<volVectorField> vvFlds;
|
||||
ReadFields(mesh, objects, vvFlds);
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
PtrList<volSphericalTensorField> vstFlds;
|
||||
ReadFields(mesh, objects, vstFlds);
|
||||
|
||||
autoPtr<incompressible::LESModel> sgsModel
|
||||
(
|
||||
incompressible::LESModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
PtrList<volSymmTensorField> vsymtFlds;
|
||||
ReadFields(mesh, objects, vsymtFlds);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
PtrList<volTensorField> vtFlds;
|
||||
ReadFields(mesh, objects, vtFlds);
|
||||
|
||||
dimensionedScalar nu(transportProperties.lookup("nu"));
|
||||
// Read surface fields.
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
|
||||
PtrList<surfaceScalarField> ssFlds;
|
||||
ReadFields(mesh, objects, ssFlds);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
PtrList<surfaceVectorField> svFlds;
|
||||
ReadFields(mesh, objects, svFlds);
|
||||
|
||||
IOobject RASPropertiesHeader
|
||||
(
|
||||
"RASProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
PtrList<surfaceSphericalTensorField> sstFlds;
|
||||
ReadFields(mesh, objects, sstFlds);
|
||||
|
||||
IOobject LESPropertiesHeader
|
||||
(
|
||||
"LESProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
PtrList<surfaceSymmTensorField> ssymtFlds;
|
||||
ReadFields(mesh, objects, ssymtFlds);
|
||||
|
||||
if (RASPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary RASProperties(RASPropertiesHeader);
|
||||
PtrList<surfaceTensorField> stFlds;
|
||||
ReadFields(mesh, objects, stFlds);
|
||||
|
||||
autoPtr<compressible::RASModel> RASModel
|
||||
(
|
||||
compressible::RASModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
// Read point fields.
|
||||
const pointMesh& pMesh = pointMesh::New(mesh);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else if (LESPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary LESProperties(LESPropertiesHeader);
|
||||
PtrList<pointScalarField> psFlds;
|
||||
ReadFields(pMesh, objects, psFlds);
|
||||
|
||||
autoPtr<compressible::LESModel> sgsModel
|
||||
(
|
||||
compressible::LESModel::New(rho, U, phi, thermo())
|
||||
);
|
||||
PtrList<pointVectorField> pvFlds;
|
||||
ReadFields(pMesh, objects, pvFlds);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
PtrList<pointSphericalTensorField> pstFlds;
|
||||
ReadFields(pMesh, objects, pstFlds);
|
||||
|
||||
dimensionedScalar mu(transportProperties.lookup("mu"));
|
||||
PtrList<pointSymmTensorField> psymtFlds;
|
||||
ReadFields(pMesh, objects, psymtFlds);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
PtrList<pointTensorField> ptFlds;
|
||||
ReadFields(pMesh, objects, ptFlds);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< nl << exit(FatalError);
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< " Reading p" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
{
|
||||
IOobject RASPropertiesHeader
|
||||
(
|
||||
"RASProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
IOobject LESPropertiesHeader
|
||||
(
|
||||
"LESProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (RASPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary RASProperties(RASPropertiesHeader);
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::RASModel> RASModel
|
||||
(
|
||||
incompressible::RASModel::New
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
laminarTransport
|
||||
)
|
||||
);
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else if (LESPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary LESProperties(LESPropertiesHeader);
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<incompressible::LESModel> sgsModel
|
||||
(
|
||||
incompressible::LESModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar nu(transportProperties.lookup("nu"));
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
IOobject RASPropertiesHeader
|
||||
(
|
||||
"RASProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
IOobject LESPropertiesHeader
|
||||
(
|
||||
"LESProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (RASPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary RASProperties(RASPropertiesHeader);
|
||||
|
||||
autoPtr<compressible::RASModel> RASModel
|
||||
(
|
||||
compressible::RASModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else if (LESPropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary LESProperties(LESPropertiesHeader);
|
||||
|
||||
autoPtr<compressible::LESModel> sgsModel
|
||||
(
|
||||
compressible::LESModel::New(rho, U, phi, thermo())
|
||||
);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar mu(transportProperties.lookup("mu"));
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,13 +42,14 @@ Description
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
# include "addRegionOption.H"
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
# include "createMeshNoClear.H"
|
||||
# include "createNamedMesh.H"
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
|
||||
|
||||
@ -37,6 +37,18 @@ void Foam::OutputFilterFunctionObject<OutputFilter>::readDict()
|
||||
dict_.readIfPresent("dictionary", dictName_);
|
||||
dict_.readIfPresent("enabled", enabled_);
|
||||
dict_.readIfPresent("storeFilter", storeFilter_);
|
||||
dict_.readIfPresent("timeStart", timeStart_);
|
||||
dict_.readIfPresent("timeEnd", timeEnd_);
|
||||
}
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::active() const
|
||||
{
|
||||
return
|
||||
enabled_
|
||||
&& time_.value() >= timeStart_
|
||||
&& time_.value() <= timeEnd_;
|
||||
}
|
||||
|
||||
|
||||
@ -94,6 +106,8 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
|
||||
dictName_(),
|
||||
enabled_(true),
|
||||
storeFilter_(true),
|
||||
timeStart_(-VGREAT),
|
||||
timeEnd_(VGREAT),
|
||||
outputControl_(t, dict)
|
||||
{
|
||||
readDict();
|
||||
@ -121,7 +135,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
|
||||
{
|
||||
readDict();
|
||||
|
||||
if (enabled_&&storeFilter_)
|
||||
if (enabled_ && storeFilter_)
|
||||
{
|
||||
allocateFilter();
|
||||
}
|
||||
@ -136,7 +150,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
||||
const bool forceWrite
|
||||
)
|
||||
{
|
||||
if (enabled_)
|
||||
if (active())
|
||||
{
|
||||
if (!storeFilter_)
|
||||
{
|
||||
@ -163,7 +177,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
||||
template<class OutputFilter>
|
||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
|
||||
{
|
||||
if (enabled_)
|
||||
if (active())
|
||||
{
|
||||
if (!storeFilter_)
|
||||
{
|
||||
|
||||
@ -68,18 +68,28 @@ class OutputFilterFunctionObject
|
||||
//- Input dictionary
|
||||
dictionary dict_;
|
||||
|
||||
//- Name of region
|
||||
word regionName_;
|
||||
|
||||
//- Optional dictionary name to supply required inputs
|
||||
word dictName_;
|
||||
// Optional user inputs
|
||||
|
||||
//- Switch for the execution of the functionObject
|
||||
bool enabled_;
|
||||
//- Name of region - defaults to name of polyMesh::defaultRegion
|
||||
word regionName_;
|
||||
|
||||
//- Dictionary name to supply required inputs
|
||||
word dictName_;
|
||||
|
||||
//- Switch for the execution - defaults to 'yes/on'
|
||||
bool enabled_;
|
||||
|
||||
//- Switch to store filter in between writes or use on-the-fly
|
||||
// construction - defaults to true
|
||||
bool storeFilter_;
|
||||
|
||||
//- Activation time - defaults to -VGREAT
|
||||
scalar timeStart_;
|
||||
|
||||
//- De-activation time - defaults to VGREAT
|
||||
scalar timeEnd_;
|
||||
|
||||
//- Switch to store filter in between writes or use on-the-fly
|
||||
// construction
|
||||
bool storeFilter_;
|
||||
|
||||
//- Output controls
|
||||
outputFilterOutputControl outputControl_;
|
||||
@ -99,6 +109,9 @@ class OutputFilterFunctionObject
|
||||
//- Destroys most of the data associated with this object.
|
||||
void destroyFilter();
|
||||
|
||||
//- Returns true if active (enabled and within time bounds)
|
||||
bool active() const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
OutputFilterFunctionObject(const OutputFilterFunctionObject&);
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "STARCDMeshReader.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
#include "oldCyclicPolyPatch.H"
|
||||
#include "emptyPolyPatch.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
@ -950,7 +950,7 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
|
||||
{
|
||||
// incorrect. should be cyclicPatch but this
|
||||
// requires info on connected faces.
|
||||
patchTypes_[patchI] = cyclicPolyPatch::typeName;
|
||||
patchTypes_[patchI] = oldCyclicPolyPatch::typeName;
|
||||
patchPhysicalTypes_[patchI] = patchTypes_[patchI];
|
||||
}
|
||||
else if (origType == "baffle")
|
||||
|
||||
@ -386,6 +386,7 @@ $(basicSource)/basicSource/basicSourceIO.C
|
||||
$(basicSource)/basicSource/basicSourceList.C
|
||||
$(basicSource)/basicSource/IObasicSourceList.C
|
||||
$(basicSource)/actuationDiskSource/actuationDiskSource.C
|
||||
$(basicSource)/radialActuationDiskSource/radialActuationDiskSource.C
|
||||
$(basicSource)/explicitSource/explicitSource.C
|
||||
|
||||
|
||||
|
||||
@ -69,12 +69,13 @@ void Foam::actuationDiskSource::checkData() const
|
||||
Foam::actuationDiskSource::actuationDiskSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
basicSource(name, dict, mesh),
|
||||
dict_(dict.subDict(typeName + "Coeffs")),
|
||||
basicSource(name, modelType, dict, mesh),
|
||||
dict_(dict.subDict(modelType + "Coeffs")),
|
||||
diskDir_(dict_.lookup("diskDir")),
|
||||
Cp_(readScalar(dict_.lookup("Cp"))),
|
||||
Ct_(readScalar(dict_.lookup("Ct"))),
|
||||
@ -97,31 +98,34 @@ void Foam::actuationDiskSource::addSu(fvMatrix<vector>& UEqn)
|
||||
compressible = true;
|
||||
}
|
||||
|
||||
const scalarField& V = this->mesh().V();
|
||||
const scalarField& cellsV = this->mesh().V();
|
||||
vectorField& Usource = UEqn.source();
|
||||
const vectorField& U = UEqn.psi();
|
||||
|
||||
if (compressible)
|
||||
if (V() > VSMALL)
|
||||
{
|
||||
addActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
V,
|
||||
this->mesh().lookupObject<volScalarField>("rho"),
|
||||
U
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
addActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
V,
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
if (compressible)
|
||||
{
|
||||
addActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
cellsV,
|
||||
this->mesh().lookupObject<volScalarField>("rho"),
|
||||
U
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
addActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
cellsV,
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,10 @@ class actuationDiskSource
|
||||
:
|
||||
public basicSource
|
||||
{
|
||||
// Private data
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Sub dictionary with actuationDisk information
|
||||
const dictionary& dict_;
|
||||
@ -87,6 +90,8 @@ class actuationDiskSource
|
||||
scalar diskArea_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Check data
|
||||
@ -122,6 +127,7 @@ public:
|
||||
actuationDiskSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
@ -36,13 +36,12 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
|
||||
(
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const scalarField& Vcells,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const
|
||||
{
|
||||
scalar a = 1.0 - Cp_/Ct_;
|
||||
scalar totVol = 0.0;
|
||||
scalarField T(cells.size());
|
||||
vector uniDiskDir = diskDir_/mag(diskDir_);
|
||||
tensor E(tensor::zero);
|
||||
@ -52,12 +51,11 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
|
||||
const vectorField U1((1.0 - a)*U);
|
||||
forAll(cells, i)
|
||||
{
|
||||
totVol += V[cells[i]];
|
||||
T[i] = 2.0*rho[cells[i]]*diskArea_*mag(U1[cells[i]])*a/(1.0 - a);
|
||||
}
|
||||
forAll(cells, i)
|
||||
{
|
||||
Usource[cells[i]] += ((V[cells[i]]/totVol)*T[i]*E) & U1[cells[i]];
|
||||
Usource[cells[i]] += ((Vcells[cells[i]]/V())*T[i]*E) & U1[cells[i]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -188,6 +188,7 @@ void Foam::basicSource::setCellSet()
|
||||
Foam::basicSource::basicSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
@ -198,7 +199,10 @@ Foam::basicSource::basicSource
|
||||
active_(readBool(dict_.lookup("active"))),
|
||||
timeStart_(readScalar(dict_.lookup("timeStart"))),
|
||||
duration_(readScalar(dict_.lookup("duration"))),
|
||||
selectionMode_(selectionModeTypeNames_.read(dict_.lookup("selectionMode"))),
|
||||
selectionMode_
|
||||
(
|
||||
selectionModeTypeNames_.read(dict_.lookup("selectionMode"))
|
||||
),
|
||||
cellSetName_("none"),
|
||||
V_(0.0)
|
||||
{
|
||||
@ -237,7 +241,7 @@ Foam::autoPtr<Foam::basicSource> Foam::basicSource::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<basicSource>(cstrIter()(name, dict, mesh));
|
||||
return autoPtr<basicSource>(cstrIter()(name, modelType, dict, mesh));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -180,10 +180,11 @@ public:
|
||||
dictionary,
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(name, dict, mesh)
|
||||
(name, modelType, dict, mesh)
|
||||
);
|
||||
|
||||
|
||||
@ -193,6 +194,7 @@ public:
|
||||
basicSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
@ -106,12 +106,13 @@ void Foam::explicitSource::setFieldData(const dictionary& dict)
|
||||
Foam::explicitSource::explicitSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
basicSource(name, dict, mesh),
|
||||
dict_(dict.subDict(typeName + "Coeffs")),
|
||||
basicSource(name, modelType, dict, mesh),
|
||||
dict_(dict.subDict(modelType + "Coeffs")),
|
||||
volumeMode_(volumeModeTypeNames_.read(dict_.lookup("volumeMode")))
|
||||
{
|
||||
setFieldData(dict_.subDict("fieldData"));
|
||||
|
||||
@ -135,6 +135,7 @@ public:
|
||||
explicitSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
@ -0,0 +1,134 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "radialActuationDiskSource.H"
|
||||
#include "geometricOneField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(radialActuationDiskSource, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
basicSource,
|
||||
radialActuationDiskSource,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::radialActuationDiskSource::radialActuationDiskSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
actuationDiskSource(name, modelType, dict, mesh),
|
||||
dict_(dict.subDict(modelType + "Coeffs")),
|
||||
coeffs_()
|
||||
{
|
||||
dict_.lookup("coeffs") >> coeffs_;
|
||||
Info<< " - creating radial actuation disk zone: "
|
||||
<< this->name() << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::radialActuationDiskSource::addSu(fvMatrix<vector>& UEqn)
|
||||
{
|
||||
bool compressible = false;
|
||||
if (UEqn.dimensions() == dimensionSet(1, 1, -2, 0, 0))
|
||||
{
|
||||
compressible = true;
|
||||
}
|
||||
|
||||
const scalarField& cellsV = this->mesh().V();
|
||||
vectorField& Usource = UEqn.source();
|
||||
const vectorField& U = UEqn.psi();
|
||||
|
||||
if (V() > VSMALL)
|
||||
{
|
||||
if (compressible)
|
||||
{
|
||||
addRadialActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
cellsV,
|
||||
this->mesh().lookupObject<volScalarField>("rho"),
|
||||
U
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
addRadialActuationDiskAxialInertialResistance
|
||||
(
|
||||
Usource,
|
||||
cells_,
|
||||
cellsV,
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::radialActuationDiskSource::writeData(Ostream& os) const
|
||||
{
|
||||
actuationDiskSource::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::radialActuationDiskSource::read(const dictionary& dict)
|
||||
{
|
||||
if (basicSource::read(dict))
|
||||
{
|
||||
const dictionary& sourceDict = dict.subDict(name());
|
||||
const dictionary& subDictCoeffs =
|
||||
sourceDict.subDict(typeName + "Coeffs");
|
||||
subDictCoeffs.readIfPresent("diskDir", diskDir_);
|
||||
subDictCoeffs.readIfPresent("Cp", Cp_);
|
||||
subDictCoeffs.readIfPresent("Ct", Ct_);
|
||||
subDictCoeffs.readIfPresent("diskArea", diskArea_);
|
||||
subDictCoeffs.lookup("coeffs") >> coeffs_;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::radialActuationDiskSource
|
||||
|
||||
Description
|
||||
Actuation disk zone definition.
|
||||
Constant values for momentum source for actuation disk
|
||||
|
||||
T = 2*rho*A*sqr(Uo)*a*(1-a)
|
||||
U1 = (1 -a)Uo
|
||||
where:
|
||||
A: disk area
|
||||
Uo: upstream velocity
|
||||
a: 1 - Cp/Ct
|
||||
U1: velocity at the disk
|
||||
|
||||
|
||||
The thrust is distributed by a radial function:
|
||||
thrust(r) = T*(C0 + C1*r^2 + C2*r^4)
|
||||
|
||||
|
||||
SourceFiles
|
||||
radialActuationDiskSource.C
|
||||
radialActuationDiskSourceTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef radialActuationDiskSource_H
|
||||
#define radialActuationDiskSource_H
|
||||
|
||||
#include "DimensionedField.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "FixedList.H"
|
||||
#include "actuationDiskSource.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class radialActuationDiskSource Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class radialActuationDiskSource
|
||||
:
|
||||
public actuationDiskSource
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Sub dictionary with model information
|
||||
const dictionary& dict_;
|
||||
|
||||
//- Coeffcients for the radial distribution
|
||||
FixedList<scalar, 3> coeffs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Add resistance to the UEqn
|
||||
template<class RhoFieldType>
|
||||
void addRadialActuationDiskAxialInertialResistance
|
||||
(
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
radialActuationDiskSource(const radialActuationDiskSource&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const radialActuationDiskSource&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("radialActuationDiskSource");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
radialActuationDiskSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~radialActuationDiskSource()
|
||||
{}
|
||||
|
||||
|
||||
// Public Functions
|
||||
|
||||
//-Source term to fvMatrix<vector>
|
||||
virtual void addSu(fvMatrix<vector>& UEqn);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write data
|
||||
virtual void writeData(Ostream&) const;
|
||||
|
||||
//- Read dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "radialActuationDiskSourceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "radialActuationDiskSource.H"
|
||||
#include "volFields.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "fvm.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class RhoFieldType>
|
||||
void Foam::radialActuationDiskSource::
|
||||
addRadialActuationDiskAxialInertialResistance
|
||||
(
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& Vcells,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const
|
||||
{
|
||||
scalar a = 1.0 - Cp_/Ct_;
|
||||
scalarField T(cells.size());
|
||||
scalarField Tr(cells.size());
|
||||
const vector uniDiskDir = diskDir_/mag(diskDir_);
|
||||
|
||||
|
||||
tensor E(tensor::zero);
|
||||
E.xx() = uniDiskDir.x();
|
||||
E.yy() = uniDiskDir.y();
|
||||
E.zz() = uniDiskDir.z();
|
||||
const vectorField U1((1.0 - a)*U);
|
||||
|
||||
const Field<vector> zoneCellCentres(mesh().cellCentres(), cells);
|
||||
const Field<scalar> zoneCellVolumes(mesh().cellVolumes(), cells);
|
||||
|
||||
const vector avgCentre = gSum(zoneCellVolumes*zoneCellCentres)/V();
|
||||
const scalar maxR = gMax(mag(zoneCellCentres - avgCentre));
|
||||
|
||||
scalar intCoeffs =
|
||||
coeffs_[0]
|
||||
+ coeffs_[1]*sqr(maxR)/2.0
|
||||
+ coeffs_[2]*pow4(maxR)/3.0;
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
T[i] = 2.0*rho[cells[i]]*diskArea_*mag(U1[cells[i]])*a/(1.0 - a);
|
||||
|
||||
scalar r = mag(mesh().cellCentres()[cells[i]] - avgCentre);
|
||||
|
||||
Tr[i] =
|
||||
T[i]*(coeffs_[0] + coeffs_[1]*sqr(r) + coeffs_[2]*pow4(r))
|
||||
/intCoeffs;
|
||||
}
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
Usource[cells[i]] += ((Vcells[cells[i]]/V())*Tr[i]*E) & U1[cells[i]];
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Source name: " << name() << nl
|
||||
<< "Average centre: " << avgCentre << nl
|
||||
<< "Maximum radius: " << maxR << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -204,14 +204,13 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
case NEARESTCELL:
|
||||
{
|
||||
const mapDistribute& distMap = mappedPatchBase::map();
|
||||
newValues = sampleField();
|
||||
|
||||
distMap.distribute(newValues);
|
||||
this->distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case NEARESTPATCHFACE:
|
||||
case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
const label nbrPatchID =
|
||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
||||
@ -230,34 +229,7 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
const mapDistribute& distMap = mappedPatchBase::map();
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
||||
{
|
||||
const label nbrPatchID =
|
||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
||||
|
||||
if (nbrPatchID < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
||||
)<< "Unable to find sample patch " << samplePatch()
|
||||
<< " in region " << sampleRegion()
|
||||
<< " for patch " << this->patch().name() << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// const fieldType& nbrField = sampleField();
|
||||
// newValues = mpp.AMI().interpolateToSource(nbrField);
|
||||
|
||||
notImplemented
|
||||
(
|
||||
"void mappedFieldFvPatchField<Type>::updateCoeffs() "
|
||||
"with mappedPatchBase::NEARESTPATCHFACEAMI"
|
||||
);
|
||||
this->distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -279,9 +251,7 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
}
|
||||
|
||||
const mapDistribute& distMap = mappedPatchBase::map();
|
||||
distMap.distribute(allValues);
|
||||
|
||||
this->distribute(allValues);
|
||||
newValues.transfer(allValues);
|
||||
|
||||
break;
|
||||
|
||||
@ -127,31 +127,7 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
// Retrieve the neighbour patch internal field
|
||||
Field<Type> nbrIntFld(nbrField.patchInternalField());
|
||||
|
||||
switch (mpp.mode())
|
||||
{
|
||||
case (mappedPatchBase::NEARESTPATCHFACEAMI):
|
||||
{
|
||||
// Retrieve the neighbour patch internal field
|
||||
nbrIntFld = mpp.AMI().interpolateToSource(nbrIntFld);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
const mapDistribute& distMap = mpp.map();
|
||||
|
||||
mapDistribute::distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
distMap.schedule(),
|
||||
distMap.constructSize(),
|
||||
distMap.subMap(), // what to send
|
||||
distMap.constructMap(), // what to receive
|
||||
nbrIntFld
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mpp.distribute(nbrIntFld);
|
||||
|
||||
// Restore tag
|
||||
UPstream::msgType() = oldTag;
|
||||
|
||||
@ -283,30 +283,6 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
break;
|
||||
}
|
||||
case mappedPatchBase::NEARESTPATCHFACE:
|
||||
{
|
||||
const mapDistribute& distMap = mpp.map();
|
||||
|
||||
const label nbrPatchID =
|
||||
nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
|
||||
|
||||
if (nbrPatchID < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
||||
)<< "Unable to find sample patch " << mpp.samplePatch()
|
||||
<< " in region " << mpp.sampleRegion()
|
||||
<< " for patch " << this->patch().name() << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const fieldType& nbrField = sampleField();
|
||||
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
||||
{
|
||||
const label nbrPatchID =
|
||||
@ -324,9 +300,9 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
|
||||
const fieldType& nbrField = sampleField();
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
|
||||
newValues = mpp.AMI().interpolateToSource(newValues);
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
mpp.distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ License
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "mappedPatchBase.H"
|
||||
#include "mapDistribute.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -128,7 +127,7 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs()
|
||||
scalarList phi =
|
||||
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
|
||||
|
||||
mpp.map().distribute(phi);
|
||||
mpp.distribute(phi);
|
||||
|
||||
|
||||
const surfaceScalarField& phiName =
|
||||
|
||||
@ -176,13 +176,10 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
||||
(
|
||||
mappedVelocityFluxFixedValueFvPatchField::patch().patch()
|
||||
);
|
||||
const mapDistribute& distMap = mpp.map();
|
||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
||||
const word& fieldName = dimensionedInternalField().name();
|
||||
const volVectorField& UField = nbrMesh.lookupObject<volVectorField>
|
||||
(
|
||||
fieldName
|
||||
);
|
||||
const volVectorField& UField =
|
||||
nbrMesh.lookupObject<volVectorField>(fieldName);
|
||||
|
||||
surfaceScalarField& phiField = const_cast<surfaceScalarField&>
|
||||
(
|
||||
@ -213,26 +210,25 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
||||
}
|
||||
}
|
||||
|
||||
distMap.distribute(allUValues);
|
||||
mpp.distribute(allUValues);
|
||||
newUValues.transfer(allUValues);
|
||||
|
||||
distMap.distribute(allPhiValues);
|
||||
mpp.distribute(allPhiValues);
|
||||
newPhiValues.transfer(allPhiValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case mappedPolyPatch::NEARESTPATCHFACE:
|
||||
case mappedPolyPatch::NEARESTPATCHFACEAMI:
|
||||
{
|
||||
const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
|
||||
(
|
||||
mpp.samplePatch()
|
||||
);
|
||||
const label nbrPatchID =
|
||||
nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
|
||||
|
||||
newUValues = UField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newUValues);
|
||||
mpp.distribute(newUValues);
|
||||
|
||||
newPhiValues = phiField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newPhiValues);
|
||||
mpp.distribute(newPhiValues);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -242,8 +238,9 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
||||
(
|
||||
"mappedVelocityFluxFixedValueFvPatchField::"
|
||||
"updateCoeffs()"
|
||||
) << "patch can only be used in NEARESTPATCHFACE or NEARESTFACE "
|
||||
<< "mode" << nl << abort(FatalError);
|
||||
) << "patch can only be used in NEARESTPATCHFACE, "
|
||||
<< "NEARESTPATCHFACEAMI or NEARESTFACE mode" << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +229,6 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
||||
const mapDistribute& distMap = mappedPatchBase::map();
|
||||
|
||||
// Result of obtaining remote values
|
||||
Field<Type> newValues;
|
||||
@ -238,6 +237,8 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
case NEARESTCELL:
|
||||
{
|
||||
const mapDistribute& distMap = mappedPatchBase::map();
|
||||
|
||||
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
||||
{
|
||||
// Need to do interpolation so need cells to sample.
|
||||
@ -275,12 +276,10 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
break;
|
||||
}
|
||||
case NEARESTPATCHFACE:
|
||||
case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
|
||||
(
|
||||
samplePatch()
|
||||
);
|
||||
const label nbrPatchID =
|
||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
||||
if (nbrPatchID < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
@ -297,7 +296,7 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
const fieldType& nbrField = sampleField();
|
||||
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newValues);
|
||||
this->distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -319,7 +318,7 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
}
|
||||
|
||||
distMap.distribute(allValues);
|
||||
this->distribute(allValues);
|
||||
|
||||
newValues.transfer(allValues);
|
||||
|
||||
|
||||
@ -97,9 +97,10 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
||||
boundBox bbSrc(srcPatch.points(), srcPatch.meshPoints());
|
||||
boundBox bbTgt(tgtPatch.points(), tgtPatch.meshPoints());
|
||||
|
||||
bbTgt.inflate(maxBoundsError);
|
||||
boundBox bbTgtInf(bbTgt);
|
||||
bbTgtInf.inflate(maxBoundsError);
|
||||
|
||||
if (!bbTgt.contains(bbSrc))
|
||||
if (!bbTgtInf.contains(bbSrc))
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
@ -109,10 +110,11 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
||||
"const primitivePatch&"
|
||||
")"
|
||||
) << "Source and target patch bounding boxes are not similar" << nl
|
||||
<< " src span : " << bbSrc.span() << nl
|
||||
<< " tgt span : " << bbTgt.span() << nl
|
||||
<< " source: " << bbSrc << nl
|
||||
<< " target: " << bbTgt << endl;
|
||||
<< " source box span : " << bbSrc.span() << nl
|
||||
<< " target box span : " << bbTgt.span() << nl
|
||||
<< " source box : " << bbSrc << nl
|
||||
<< " target box : " << bbTgt << nl
|
||||
<< " inflated target box : " << bbTgtInf << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,11 +57,17 @@ namespace Foam
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Foam::timeSelector::addOptions();
|
||||
# include "addRegionOption.H"
|
||||
Foam::argList::addBoolOption
|
||||
(
|
||||
"noWrite",
|
||||
"suppress writing results"
|
||||
);
|
||||
Foam::argList::addBoolOption
|
||||
(
|
||||
"noFlow",
|
||||
"suppress creating flow models (execFlowFunctionObjects only)"
|
||||
);
|
||||
Foam::argList::addOption
|
||||
(
|
||||
"dict",
|
||||
@ -72,7 +78,7 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
#include "createMesh.H"
|
||||
#include "createNamedMesh.H"
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::temperatureThermoBaffle1DFvPatchScalarField
|
||||
|
||||
Description
|
||||
Bounday which solves the 1D steady state heat transfer equation
|
||||
Boundary which solves the 1D steady state heat transfer equation
|
||||
through a baffle.
|
||||
|
||||
SourceFiles
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
location "constant/polyMesh";
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
6
|
||||
(
|
||||
rotor
|
||||
{
|
||||
type wall;
|
||||
nFaces 192;
|
||||
startFace 5856;
|
||||
}
|
||||
stator
|
||||
{
|
||||
type wall;
|
||||
nFaces 192;
|
||||
startFace 6048;
|
||||
}
|
||||
AMI1
|
||||
{
|
||||
type cyclicAMI;
|
||||
nFaces 96;
|
||||
startFace 6240;
|
||||
matchTolerance 0.0001;
|
||||
neighbourPatch AMI2;
|
||||
transform noOrdering;
|
||||
surface
|
||||
{
|
||||
type searchableCylinder;
|
||||
point1 ( 0 0 -1 );
|
||||
point2 ( 0 0 1 );
|
||||
radius 0.5;
|
||||
}
|
||||
}
|
||||
AMI2
|
||||
{
|
||||
type cyclicAMI;
|
||||
nFaces 96;
|
||||
startFace 6336;
|
||||
matchTolerance 0.0001;
|
||||
neighbourPatch AMI1;
|
||||
transform noOrdering;
|
||||
surface
|
||||
{
|
||||
type searchableCylinder;
|
||||
point1 ( 0 0 -1 );
|
||||
point2 ( 0 0 1 );
|
||||
radius 0.5;
|
||||
}
|
||||
}
|
||||
front
|
||||
{
|
||||
type empty;
|
||||
nFaces 3072;
|
||||
startFace 6432;
|
||||
}
|
||||
back
|
||||
{
|
||||
type empty;
|
||||
nFaces 3072;
|
||||
startFace 9504;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user