ENH: 1) Adding self extrusion and defaulting some inputs in 3D thermal baffles

2) Changing 1D steady baffle to mixture BC and simplifying inputs
     3) Reorganizing circuitBoardCooling tutorial
This commit is contained in:
Sergio Ferraris
2013-11-05 11:20:38 +00:00
parent dd3d72e176
commit 084194c7bd
43 changed files with 954 additions and 1005 deletions

View File

@ -47,14 +47,15 @@ extrudePatchMesh::extrudePatchMesh
(
const fvMesh& mesh,
const fvPatch& patch,
const dictionary& dict
const dictionary& dict,
const word regionName
)
:
fvMesh
(
IOobject
(
dict.lookup("region"),
regionName,
mesh.facesInstance(),
mesh,
IOobject::READ_IF_PRESENT,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,12 +25,11 @@ Class
extrudePatchMesh
Description
Mesh at a patch created on the fly. The following entried should be used
Mesh at a patch created on the fly. The following entry should be used
on the field boundary dictionary:
// New Shell mesh data
region "regionMesh";
extrudeModel linearNormal;
linearNormalCoeffs
{
@ -120,7 +119,8 @@ public:
(
const fvMesh&,
const fvPatch&,
const dictionary&
const dictionary&,
const word
);

View File

@ -7,7 +7,9 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/mesh/extrudeModel/lnInclude
LIB_LIBS = \
-lregionModels \
@ -16,4 +18,5 @@ LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lOpenFOAM \
-lradiationModels
-lradiationModels \
-ldynamicMesh

View File

@ -45,7 +45,8 @@ thermalBaffleFvPatchScalarField
turbulentTemperatureRadCoupledMixedFvPatchScalarField(p, iF),
owner_(false),
baffle_(),
dict_(dictionary::null)
dict_(dictionary::null),
extrudeMeshPtr_()
{}
@ -66,8 +67,9 @@ thermalBaffleFvPatchScalarField
mapper
),
owner_(ptf.owner_),
baffle_(ptf.baffle_),
dict_(ptf.dict_)
baffle_(),
dict_(ptf.dict_),
extrudeMeshPtr_()
{}
@ -82,47 +84,47 @@ thermalBaffleFvPatchScalarField
turbulentTemperatureRadCoupledMixedFvPatchScalarField(p, iF, dict),
owner_(false),
baffle_(),
dict_(dict)
dict_(dict),
extrudeMeshPtr_()
{
if (!isA<mappedPatchBase>(patch().patch()))
{
FatalErrorIn
(
"thermalBaffleFvPatchScalarField::"
"thermalBaffleFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << patch().type()
<< "' not type '" << mappedPatchBase::typeName << "'"
<< "\n for patch " << patch().name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const word nbrMesh = mpp.sampleRegion();
const fvMesh& thisMesh = patch().boundaryMesh().mesh();
typedef regionModels::thermalBaffleModels::thermalBaffleModel baffle;
if
(
thisMesh.name() == polyMesh::defaultRegion
&& !thisMesh.foundObject<baffle>(nbrMesh)
&& !owner_
)
if (thisMesh.name() == polyMesh::defaultRegion)
{
Info << "Creating thermal baffle" << nbrMesh << endl;
baffle_.reset(baffle::New(thisMesh, dict).ptr());
owner_ = true;
baffle_->rename(nbrMesh);
const word regionName =
dict_.lookupOrDefault<word>("regionName", "none");
const word baffleName("3DBaffle" + regionName);
if
(
!thisMesh.time().foundObject<fvMesh>(regionName)
&& regionName != "none"
)
{
if (extrudeMeshPtr_.empty())
{
createPatchMesh();
}
baffle_.reset(baffle::New(thisMesh, dict).ptr());
owner_ = true;
baffle_->rename(baffleName);
}
else if //Backwards compatibility (if region exists)
(
thisMesh.time().foundObject<fvMesh>(regionName)
&& baffle_.empty()
&& regionName != "none"
)
{
baffle_.reset(baffle::New(thisMesh, dict).ptr());
owner_ = true;
baffle_->rename(baffleName);
}
}
}
@ -136,8 +138,9 @@ thermalBaffleFvPatchScalarField
:
turbulentTemperatureRadCoupledMixedFvPatchScalarField(ptf, iF),
owner_(ptf.owner_),
baffle_(ptf.baffle_),
dict_(ptf.dict_)
baffle_(),
dict_(ptf.dict_),
extrudeMeshPtr_()
{}
@ -163,6 +166,36 @@ void thermalBaffleFvPatchScalarField::rmap
}
void thermalBaffleFvPatchScalarField::createPatchMesh()
{
const fvMesh& defaultRegion =
db().time().lookupObject<fvMesh>(fvMesh::defaultRegion);
word regionName = dict_.lookup("regionName");
extrudeMeshPtr_.reset
(
new extrudePatchMesh
(
defaultRegion,
patch(),
dict_,
regionName
)
);
if (extrudeMeshPtr_.empty())
{
WarningIn
(
"thermalBaffleFvPatchScalarField::createPatchMesh()\n"
) << "Specified IOobject::MUST_READ_IF_MODIFIED but class"
<< " patchMeshPtr not set."
<< endl;
}
}
void thermalBaffleFvPatchScalarField::updateCoeffs()
{
if (this->updated())
@ -189,27 +222,35 @@ void thermalBaffleFvPatchScalarField::write(Ostream& os) const
if (thisMesh.name() == polyMesh::defaultRegion && owner_)
{
word thermoModel = dict_.lookup("thermalBaffleModel");
os.writeKeyword("thermalBaffleModel")
<< thermoModel
<< token::END_STATEMENT << nl;
os.writeKeyword("extrudeModel");
os << word(dict_.lookup("extrudeModel"))
<< token::END_STATEMENT << nl;
os.writeKeyword("nLayers");
os << readLabel(dict_.lookup("nLayers"))
<< token::END_STATEMENT << nl;
os.writeKeyword("expansionRatio");
os << readScalar(dict_.lookup("expansionRatio"))
<< token::END_STATEMENT << nl;
os.writeKeyword("columnCells");
os << readBool(dict_.lookup("columnCells"))
<< token::END_STATEMENT << nl;
word extrudeModel(word(dict_.lookup("extrudeModel")) + "Coeffs");
os.writeKeyword(extrudeModel);
os << dict_.subDict(extrudeModel) << nl;
word regionName = dict_.lookup("regionName");
os.writeKeyword("regionName") << regionName
<< token::END_STATEMENT << nl;
bool infoOutput = readBool(dict_.lookup("infoOutput"));
os.writeKeyword("infoOutput") << infoOutput
<< token::END_STATEMENT << nl;
bool active = readBool(dict_.lookup("active"));
os.writeKeyword("active") << active
<< token::END_STATEMENT << nl;
os.writeKeyword(word(thermoModel + "Coeffs"));
os << dict_.subDict(thermoModel + "Coeffs") << nl;
os.writeKeyword("thermoType");
os << dict_.subDict("thermoType") << nl;

View File

@ -42,78 +42,111 @@ Description
dictionary entries.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type compressible::temperatureThermoBaffle;
// Coupled boundary condition
Tnbr T;
kappa fluidThermo; // or solidThermo
KappaName none;
QrNbr Qr; // or none.Name of Qr field on neighbour region
Qr Qr; // or none.Name of Qr field on local region
// Underlaying coupled boundary condition
Tnbr T;
kappa fluidThermo; // or solidThermo
KappaName none;
QrNbr Qr;//or none.Name of Qr field on neighbourregion
Qr none;// or none.Name of Qr field on localregion
value uniform 300;
// Thermo baffle model
thermalBaffleModel thermalBaffle;
regionName baffleRegion;
infoOutput yes;
active yes;
thermalBaffleCoeffs
{
}
regionName baffleRegion; // solid region name
infoOutput yes;
active yes;
// Solid thermo
thermoType
{
type heSolidThermo;
mixture pureSolidMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
// Solid thermo in solid region
thermoType
{
nMoles 1;
molWeight 20;
type heSolidThermo;
mixture pureSolidMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
transport
{
kappa 0.01;
}
thermodynamics
{
Hf 0;
Cp 15;
}
density
{
rho 80;
}
}
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
mixture
{
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa 0.01;
}
thermodynamics
{
Hf 0;
Cp 15;
}
density
{
rho 80;
}
}
value uniform 300;
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
// Extrude model for new region
extrudeModel linearNormal;
nLayers 50;
expansionRatio 1;
columnCells false; //3D or 1D
linearNormalCoeffs
{
thickness 0.02;
}
// New mesh polyPatch information
bottomCoeffs
{
name "bottom";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle3DWall_master;
offsetMode uniform;
offset (0 0 0);
}
topCoeffs
{
name "top";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle3DWall_slave;
offsetMode uniform;
offset (0 0 0);
}
sideCoeffs
{
name "side";
type patch;
}
}
\endverbatim
SeeAlso
Foam::turbulentTemperatureRadCoupledMixedFvPatchScalarField
Foam::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
Foam::regionModels::thermalBaffleModels::thermalBaffleModel
SourceFiles
@ -128,6 +161,7 @@ SourceFiles
#include "autoPtr.H"
#include "regionModel.H"
#include "thermalBaffleModel.H"
#include "extrudePatchMesh.H"
#include "turbulentTemperatureRadCoupledMixedFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -157,6 +191,14 @@ class thermalBaffleFvPatchScalarField
//- Dictionary
dictionary dict_;
//- Auto pointer to extrapolated mesh from patch
autoPtr<extrudePatchMesh> extrudeMeshPtr_;
// Private member functions
//- Extrude mesh
void createPatchMesh();
public:

View File

@ -53,11 +53,14 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh)
)
);
thermalBafflePropertiesDict.lookup("thermalBaffleModel") >> modelType;
word modelType =
thermalBafflePropertiesDict.lookupOrDefault<word>
(
"thermalBaffleModel",
"thermalBaffle"
);
}
Info<< "Selecting baffle model " << modelType << endl;
meshConstructorTable::iterator cstrIter =
meshConstructorTablePtr_->find(modelType);
@ -82,9 +85,8 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New
const dictionary& dict
)
{
word modelType = dict.lookup("thermalBaffleModel");
Info<< "Selecting baffle model " << modelType << endl;
word modelType =
dict.lookupOrDefault<word>("thermalBaffleModel", "thermalBaffle");
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);

View File

@ -46,13 +46,17 @@ thermalBaffle1DFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
mappedPatchBase(p.patch()),
mixedFvPatchScalarField(p, iF),
TName_("T"),
baffleActivated_(true),
thickness_(p.size()),
Qs_(p.size()),
solidDict_(),
solidPtr_(NULL)
solidPtr_(NULL),
QrPrevious_(p.size()),
QrRelaxation_(0),
QrName_("undefined-Qr")
{}
@ -66,13 +70,17 @@ thermalBaffle1DFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
mappedPatchBase(p.patch(), ptf),
mixedFvPatchScalarField(ptf, p, iF, mapper),
TName_(ptf.TName_),
baffleActivated_(ptf.baffleActivated_),
thickness_(ptf.thickness_),
Qs_(ptf.Qs_),
solidDict_(ptf.solidDict_),
solidPtr_(ptf.solidPtr_)
solidPtr_(ptf.solidPtr_),
QrPrevious_(ptf.QrPrevious_),
QrRelaxation_(ptf.QrRelaxation_),
QrName_(ptf.QrName_)
{}
@ -85,33 +93,25 @@ thermalBaffle1DFvPatchScalarField
const dictionary& dict
)
:
mappedPatchBase
(
p.patch(),
p.boundaryMesh().mesh().name(),
NEARESTPATCHFACE,
dict.lookup("samplePatch"),
0.0
),
mixedFvPatchScalarField(p, iF),
TName_("T"),
baffleActivated_(readBool(dict.lookup("baffleActivated"))),
thickness_(scalarField("thickness", dict, p.size())),
Qs_(scalarField("Qs", dict, p.size())),
baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)),
thickness_(),
Qs_(),
solidDict_(dict),
solidPtr_(new solidType(dict))
solidPtr_(),
QrPrevious_(p.size(), 0.0),
QrRelaxation_(dict.lookupOrDefault<scalar>("relaxation", 0)),
QrName_(dict.lookupOrDefault<word>("Qr", "none"))
{
if (!isA<mappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
"thermalBaffle1DFvPatchScalarField::"
"thermalBaffle1DFvPatchScalarField"
"("
"const fvPatch&,\n"
"const DimensionedField<scalar, volMesh>&, "
"const dictionary&"
")"
) << "\n patch type '" << patch().type()
<< "' not type '" << mappedPatchBase::typeName << "'"
<< "\n for patch " << patch().name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue") && baffleActivated_)
@ -139,13 +139,17 @@ thermalBaffle1DFvPatchScalarField
const thermalBaffle1DFvPatchScalarField& ptf
)
:
mappedPatchBase(ptf.patch().patch(), ptf),
mixedFvPatchScalarField(ptf),
TName_(ptf.TName_),
baffleActivated_(ptf.baffleActivated_),
thickness_(ptf.thickness_),
Qs_(ptf.Qs_),
solidDict_(ptf.solidDict_),
solidPtr_(ptf.solidPtr_)
solidPtr_(ptf.solidPtr_),
QrPrevious_(ptf.QrPrevious_),
QrRelaxation_(ptf.QrRelaxation_),
QrName_(ptf.QrName_)
{}
@ -157,29 +161,118 @@ thermalBaffle1DFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
mappedPatchBase(ptf.patch().patch(), ptf),
mixedFvPatchScalarField(ptf, iF),
TName_(ptf.TName_),
baffleActivated_(ptf.baffleActivated_),
thickness_(ptf.thickness_),
Qs_(ptf.Qs_),
solidDict_(ptf.solidDict_),
solidPtr_(ptf.solidPtr_)
solidPtr_(ptf.solidPtr_),
QrPrevious_(ptf.QrPrevious_),
QrRelaxation_(ptf.QrRelaxation_),
QrName_(ptf.QrName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class solidType>
const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solidPtr() const
bool thermalBaffle1DFvPatchScalarField<solidType>::owner() const
{
if (!solidPtr_.empty())
const label patchi = patch().index();
const label nbrPatchi = samplePolyPatch().index();
return (patchi < nbrPatchi);
}
template<class solidType>
const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid() const
{
if (this->owner())
{
if (solidPtr_.empty())
{
solidPtr_.reset(new solidType(solidDict_));
}
return solidPtr_();
}
else
{
solidPtr_.reset(new solidType(solidDict_));
return solidPtr_();
const fvPatch& nbrPatch =
patch().boundaryMesh()[samplePolyPatch().index()];
const thermalBaffle1DFvPatchScalarField& nbrField =
refCast<const thermalBaffle1DFvPatchScalarField>
(
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
);
return nbrField.solid();
}
}
template<class solidType>
const scalarField& thermalBaffle1DFvPatchScalarField<solidType>::
baffleThickness() const
{
if (this->owner())
{
if (thickness_.size() > 0)
{
return thickness_;
}
else
{
thickness_ = scalarField("thickness", solidDict_, patch().size());
return thickness_;
}
}
else
{
const fvPatch& nbrPatch =
patch().boundaryMesh()[samplePolyPatch().index()];
const thermalBaffle1DFvPatchScalarField& nbrField =
refCast<const thermalBaffle1DFvPatchScalarField>
(
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
);
return nbrField.thickness_;
}
}
template<class solidType>
const scalarField& thermalBaffle1DFvPatchScalarField<solidType>::Qs() const
{
if (this->owner())
{
if (Qs_.size() > 0)
{
return Qs_;
}
else
{
Qs_ = scalarField("Qs", solidDict_, patch().size());
return Qs_;
}
}
else
{
const fvPatch& nbrPatch =
patch().boundaryMesh()[samplePolyPatch().index()];
const thermalBaffle1DFvPatchScalarField& nbrField =
refCast<const thermalBaffle1DFvPatchScalarField>
(
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
);
return nbrField.Qs_;
}
}
@ -219,18 +312,14 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
{
return;
}
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag+1;
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const label patchi = patch().index();
const label nbrPatchi = mpp.samplePolyPatch().index();
const label nbrPatchi = samplePolyPatch().index();
if (baffleActivated_)
{
@ -243,108 +332,49 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
);
// local properties
const scalarField kappaw(turbModel.kappaEff(patchi));
const fvPatchScalarField& Tp =
patch().template lookupPatchField<volScalarField, scalar>(TName_);
const scalarField qDot(kappaw*Tp.snGrad());
scalarField Qr(Tp.size(), 0.0);
if (QrName_ != "none")
{
Qr = patch().template lookupPatchField<volScalarField, scalar>
(QrName_);
Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_;
QrPrevious_ = Qr;
}
tmp<scalarField> Ti = patchInternalField();
scalarField myh(patch().deltaCoeffs()*kappaw);
scalarField myKDelta(patch().deltaCoeffs()*kappaw);
// nbr properties
const scalarField nbrKappaw(turbModel.kappaEff(nbrPatchi));
const fvPatchScalarField& nbrTw =
// nrb properties
const fvPatchScalarField& nbrTp =
turbModel.thermo().T().boundaryField()[nbrPatchi];
scalarField nbrQDot(nbrKappaw*nbrTw.snGrad());
mpp.map().distribute(nbrQDot);
const thermalBaffle1DFvPatchScalarField& nbrField =
refCast<const thermalBaffle1DFvPatchScalarField>
(
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
);
scalarField nbrTi(nbrField.patchInternalField());
mpp.map().distribute(nbrTi);
scalarField nbrTp =
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_);
mpp.map().distribute(nbrTp);
scalarField nbrh(nbrPatch.deltaCoeffs()*nbrKappaw);
mpp.map().distribute(nbrh);
// heat source
const scalarField Q(Qs_/thickness_);
tmp<scalarField> tKDeltaw(new scalarField(patch().size()));
scalarField KDeltaw = tKDeltaw();
// Create fields for solid properties (p paramater not used)
forAll(KDeltaw, i)
// solid properties
scalarField kappas(patch().size(), 0.0);
forAll(kappas, i)
{
KDeltaw[i] =
solidPtr().kappa(0.0, (Tp[i] + nbrTw[i])/2.0)/thickness_[i];
kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
}
const scalarField q
(
(Ti() - nbrTi)/(1.0/KDeltaw + 1.0/nbrh + 1.0/myh)
);
scalarField KDeltaSolid(kappas/baffleThickness());
forAll(qDot, i)
{
if (Qs_[i] == 0)
{
this->refValue()[i] = Ti()[i] - q[i]/myh[i];
this->refGrad()[i] = 0.0;
this->valueFraction()[i] = 1.0;
}
else
{
if (q[i] > 0)
{
this->refValue()[i] =
nbrTp[i]
- Q[i]*thickness_[i]/(2*KDeltaw[i]);
scalarField alpha(KDeltaSolid - Qr/Tp);
this->refGrad()[i] = 0.0;
this->valueFraction()[i] =
1.0
/
(
1.0
+ patch().deltaCoeffs()[i]*kappaw[i]/KDeltaw[i]
);
}
else if (q[i] < 0)
{
this->refValue()[i] = 0.0;
this->refGrad()[i] =
(-nbrQDot[i] + Q[i]*thickness_[i])/kappaw[i];
this->valueFraction()[i] = 0.0;
}
else
{
scalar Qt = Q[i]*thickness_[i];
this->refValue()[i] = 0.0;
this->refGrad()[i] = Qt/2/kappaw[i];
this->valueFraction()[i] = 0.0;
}
}
}
valueFraction() = alpha/(alpha + myKDelta);
refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/alpha;
if (debug)
{
scalar Q = gSum(patch().magSf()*qDot);
scalar Q = gAverage(kappaw*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " <- "
@ -366,16 +396,21 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
}
template<class solidType>
void thermalBaffle1DFvPatchScalarField<solidType>:: write(Ostream& os) const
void thermalBaffle1DFvPatchScalarField<solidType>::write(Ostream& os) const
{
mixedFvPatchScalarField::write(os);
os.writeKeyword("TName")
<< TName_ << token::END_STATEMENT << nl;
thickness_.writeEntry("thickness", os);
os.writeKeyword("baffleActivated")
<< baffleActivated_ << token::END_STATEMENT << nl;
Qs_.writeEntry("Qs", os);
solidPtr().write(os);
mappedPatchBase::write(os);
if (this->owner())
{
baffleThickness().writeEntry("thickness", os);
Qs().writeEntry("Qs", os);
solid().write(os);
}
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
os.writeKeyword("QrRelaxation")<< QrRelaxation_
<< token::END_STATEMENT << nl;
}

View File

@ -24,9 +24,68 @@ License
Class
Foam::thermalBaffle1DFvPatchScalarField
Group
grpThermoBoundaryConditions
Description
Boundary which solves the 1D steady state heat transfer equation
through a baffle.
This BC solves a steady 1D thermal baffle. The solid properties are
specify as dictionary. Optionaly radiative heat flux (Qr) can be
incorporated into the balance. Some under-relaxation might be needed on
Qr.
Baffle and solid properties need to be specified on the master side
of the baffle.
\heading Patch usage
Example of the boundary condition specification using constant
solid thermo :
\verbatim
myPatch_master
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
samplePatch myPatch_slave;
thickness uniform 0.005; // thickness [m]
Qs uniform 100; // heat flux [W/m2]
Qr none;
relaxation 0;
// Solid thermo
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cp 10;
}
equationOfState
{
rho 10;
}
value uniform 300;
}
myPatch_slave
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
samplePatch myPatch_master_master;
Qr none;
relaxation 0;
}
\endverbatim
SourceFiles
thermalBaffle1DFvPatchScalarField.C
@ -38,7 +97,7 @@ SourceFiles
#include "mixedFvPatchFields.H"
#include "autoPtr.H"
#include "mappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,6 +113,7 @@ namespace compressible
template<class solidType>
class thermalBaffle1DFvPatchScalarField
:
public mappedPatchBase,
public mixedFvPatchScalarField
{
// Private data
@ -65,10 +125,10 @@ class thermalBaffle1DFvPatchScalarField
bool baffleActivated_;
//- Baffle thickness [m]
scalarField thickness_;
mutable scalarField thickness_;
//- Superficial heat source [W/m2]
scalarField Qs_;
mutable scalarField Qs_;
//- Solid dictionary
dictionary solidDict_;
@ -76,11 +136,29 @@ class thermalBaffle1DFvPatchScalarField
//- Solid thermo
mutable autoPtr<solidType> solidPtr_;
//- Chache Qr for relaxation
scalarField QrPrevious_;
//- Relaxation for Qr
scalar QrRelaxation_;
//- Name of the radiative heat flux in local region
const word QrName_;
// Private members
//- Return non const solid thermo autoMap
const solidType& solidPtr() const;
//- Return const solid thermo
const solidType& solid() const;
//- Return Qs from master
const scalarField& Qs() const;
//- Return thickness from master
const scalarField& baffleThickness() const;
//- Is Owner
bool owner() const;
public:
@ -153,7 +231,6 @@ public:
// Member functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
@ -170,8 +247,6 @@ public:
);
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;

View File

@ -46,6 +46,7 @@ boundaryField
{
type empty;
}
}

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -1 0 0 0 0 ];
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
@ -24,11 +24,13 @@ boundaryField
floor
{
type compressible::alphatWallFunction;
Prt 0.85;
value uniform 0;
}
ceiling
{
type compressible::alphatWallFunction;
Prt 0.85;
value uniform 0;
}
inlet

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300;
boundaryField
{
bottom
{
type compressible::thermalBaffle;
Tnbr T;
kappa solidThermo;
kappaName none;
QrNbr none;
Qr none;
value uniform 300;
}
side
{
type zeroGradient;
}
top
{
type compressible::thermalBaffle;
Tnbr T;
kappa solidThermo;
kappaName none;
QrNbr none;
Qr none;
value uniform 300;
}
}
// ************************************************************************* //

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.01;
@ -24,11 +24,17 @@ boundaryField
floor
{
type compressible::epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.01;
}
ceiling
{
type compressible::epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.01;
}
inlet

View File

@ -5,27 +5,18 @@
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
T
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermalBaffleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
samplePatch baffle1DWall_slave;
thermalBaffleModel none;
thickness uniform 0.005; // thickness [m]
Qs uniform 100; // heat flux [W/m2]
active no;
# include "1DbaffleSolidThermo"
regionName none;
thermalBaffleCoeffs
{
value uniform 300;
}
noThermoCoeffs
{
}
// ************************************************************************* //

View File

@ -0,0 +1,16 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
T
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
samplePatch baffle1DWall_master;
value uniform 300;
}
// ************************************************************************* //

View File

@ -5,23 +5,24 @@
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
specie
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
nMoles 1;
molWeight 20;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300;
boundaryField
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cp 10;
}
equationOfState
{
rho 10;
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
T
{
type compressible::thermalBaffle;
Tnbr T;
kappa fluidThermo;
kappaName none;
QrNbr none;
Qr none;
value uniform 300;
// Thermo baffle model
//thermalBaffleModel thermalBaffle;
regionName ${baffleRegionName};
active yes;
# include "3DbaffleSolidThermo"
// New fvMesh (region) information
# include "extrudeModel"
// New mesh polyPatch information
bottomCoeffs
{
name "bottom";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch ${masterPatchName};
offsetMode uniform;
offset (0 0 0);
}
topCoeffs
{
name "top";
type mappedWall;
sampleMode nearestPatchFace;
samplePatch ${slavePatchName};
offsetMode uniform;
offset (0 0 0);
}
sideCoeffs
{
name "side";
type patch;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
T
{
type compressible::thermalBaffle;
Tnbr T;
kappa fluidThermo;
kappaName none;
QrNbr none;
Qr none;
value uniform 300;
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// Solid thermo
thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa ${Kappa};
}
thermodynamics
{
Hf 0;
Cp ${Cp};
}
equationOfState
{
rho ${rho};
}
}
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
// ************************************************************************* //

View File

@ -5,34 +5,14 @@
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object extrudeToRegionMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
region baffleRegion;
faceZones (baffleFaces2);
oneD false;
extrudeModel linearNormal;
nLayers 10;
expansionRatio 1;
adaptMesh yes; // apply directMapped to both regions
sampleMode nearestPatchFace;
extrudeModel linearNormal;
nLayers ${nLayers};
expansionRatio 1;
columnCells ${oneD}; //3D
linearNormalCoeffs
{
thickness 0.02;
thickness ${thickness};
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
baffleRegionName baffle3DRegion;
masterPatchName baffle3DRegionMaster;
slavePatchName baffle3DRegionSlave;
oneD false;
nLayers 50;
thickness 0.02;
Kappa 0.01;
Cp 15;
rho 80;
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
alphat
{
type compressible::alphatWallFunction;
value uniform 0;
}
epsilon
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
k
{
type compressible::kqRWallFunction;
value uniform 0.01;
}
mut
{
type mutkWallFunction;
value uniform 0;
}
p
{
type calculated;
value uniform 101325;
}
p_rgh
{
type fixedFluxPressure;
}
U
{
type fixedValue;
value uniform (0 0 0);
}
// ************************************************************************* //

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.1;
@ -44,6 +44,7 @@ boundaryField
{
type empty;
}
}

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -1 0 0 0 0 ];
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
@ -24,11 +24,17 @@ boundaryField
floor
{
type mutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
ceiling
{
type mutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
inlet
@ -45,6 +51,7 @@ boundaryField
{
type empty;
}
}

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -2 0 0 0 0 ];
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
@ -24,27 +24,28 @@ boundaryField
floor
{
type calculated;
value $internalField;
value uniform 101325;
}
ceiling
{
type calculated;
value $internalField;
value uniform 101325;
}
inlet
{
type calculated;
value $internalField;
value uniform 101325;
}
outlet
{
type calculated;
value $internalField;
value uniform 101325;
}
fixedWalls
{
type empty;
}
}

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 1 -1 -2 0 0 0 0 ];
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
@ -24,27 +24,31 @@ boundaryField
floor
{
type fixedFluxPressure;
value $internalField;
gradient uniform 0;
value uniform 101325;
}
ceiling
{
type fixedFluxPressure;
value $internalField;
gradient uniform 0;
value uniform 101325;
}
inlet
{
type fixedFluxPressure;
value $internalField;
gradient uniform 0;
value uniform 101325;
}
outlet
{
type fixedValue;
value $internalField;
value uniform 101325;
}
fixedWalls
{
type empty;
}
}

View File

@ -5,7 +5,8 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf constant/baffleRegion/polyMesh
rm -rf sets 0
rm -rf constant/baffle3DRegion
rm -rf constant/polyMesh/boundary
rm -rf 0
# ----------------------------------------------------------------- end-of-file

View File

@ -4,25 +4,11 @@
# Get application name
application=`getApplication`
cp -r 0.org 0
runApplication blockMesh
runApplication topoSet
cp -r 0.org 0
unset FOAM_SETNAN
unset FOAM_SIGFPE
# Create first baffle
# Create 1D and 3D baffles
runApplication createBaffles -overwrite
# Create region
runApplication extrudeToRegionMesh -overwrite
# Set Bc's for the region baffle
runApplication changeDictionary -dict system/changeDictionaryDict.baffleRegion -literalRE
rm log.changeDictionary
# Reset proper values at the region
runApplication changeDictionary -region baffleRegion -literalRE
runApplication $application

View File

@ -22,10 +22,10 @@ vertices
(10 0 0)
(10 5 0)
(0 5 0)
(0 0 10)
(10 0 10)
(10 5 10)
(0 5 10)
(0 0 1)
(10 0 1)
(10 5 1)
(0 5 1)
);
blocks

View File

@ -0,0 +1,16 @@
solid ascii
facet normal -1 0 0
outer loop
vertex 0.3 0 0
vertex 0.3 0 0.1
vertex 0.3 0.2 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.3 0.2 0.1
vertex 0.3 0.2 0
vertex 0.3 0 0.1
endloop
endfacet
endsolid

View File

@ -0,0 +1,58 @@
solid ascii
facet normal -1 0 0
outer loop
vertex 0.59 0 0
vertex 0.59 0 0.05
vertex 0.59 0.1 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.1 0.05
vertex 0.59 0.1 0
vertex 0.59 0 0.05
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0 0.05
vertex 0.59 0 0.1
vertex 0.59 0.1 0.05
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.1 0.1
vertex 0.59 0.1 0.05
vertex 0.59 0 0.1
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.1 0
vertex 0.59 0.1 0.05
vertex 0.59 0.2 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.2 0.05
vertex 0.59 0.2 0
vertex 0.59 0.1 0.05
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.1 0.05
vertex 0.59 0.1 0.1
vertex 0.59 0.2 0.05
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.59 0.2 0.1
vertex 0.59 0.2 0.05
vertex 0.59 0.1 0.1
endloop
endfacet
endsolid

View File

@ -1,58 +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 dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
{
boundaryField
{
"region0_to.*"
{
type compressible::thermalBaffle;
Tnbr T;
kappa solidThermo;
kappaName none;
QrNbr none;
Qr none;
value uniform 300;
}
baffleFaces2_side
{
type zeroGradient;
}
floor
{
type fixedValue;
value uniform 300;
}
fixedWalls
{
type empty;
}
}
}
boundary
{
floor
{
type patch;
}
}
}
// ************************************************************************* //

View File

@ -1,125 +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 dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
alphat
{
boundaryField
{
"baffle.*"
{
type compressible::alphatWallFunction;
value uniform 0;
}
}
}
epsilon
{
boundaryField
{
"baffle.*"
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
}
}
k
{
boundaryField
{
"baffle.*"
{
type compressible::kqRWallFunction;
value uniform 0.01;
}
}
}
mut
{
boundaryField
{
"baffle.*"
{
type mutkWallFunction;
value uniform 0.0;
}
}
}
p
{
boundaryField
{
"baffle.*"
{
type calculated;
value uniform 101325;
}
}
}
p_rgh
{
boundaryField
{
"baffle.*"
{
type fixedFluxPressure;
value uniform 0;
}
}
}
T
{
boundaryField
{
"baffle.*"
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
baffleActivated yes;
thickness uniform 0.005; // thickness [m]
Qs uniform 100; // heat flux [W/m2]
transport
{
kappa 1.0;
}
thermodynamics
{
Hf 0;
Cp 0;
}
equationOfState
{
rho 0;
}
value uniform 300;
}
}
}
U
{
boundaryField
{
"baffle.*"
{
type fixedValue;
value uniform (0 0 0);
}
}
}
}
// ************************************************************************* //

View File

@ -1,130 +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 dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
alphat
{
boundaryField
{
"baffle1.*"
{
type compressible::alphatWallFunction;
value uniform 0;
}
}
}
epsilon
{
boundaryField
{
"baffle1.*"
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
}
}
k
{
boundaryField
{
"baffle1.*"
{
type compressible::kqRWallFunction;
value uniform 0.01;
}
}
}
mut
{
boundaryField
{
"baffle1.*"
{
type mutkWallFunction;
value uniform 0.0;
}
}
}
p
{
boundaryField
{
"baffle1.*"
{
type calculated;
value $internalField;
}
}
}
p_rgh
{
boundaryField
{
"baffle1.*"
{
type fixedFluxPressure;
value $internalField;
}
}
}
T
{
boundaryField
{
"baffle1Wall.*"
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
baffleActivated yes;
thickness uniform 0.005; // thickness [m]
Qs uniform 100; // heat flux [W/m2]
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cp 10;
}
equationOfState
{
rho 10;
}
value uniform 300;
}
}
}
U
{
boundaryField
{
"baffle1.*"
{
type fixedValue;
value uniform (0 0 0);
}
}
}
}
// ************************************************************************* //

View File

@ -1,171 +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 dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
alphat
{
boundaryField
{
"region0_to_.*"
{
type compressible::alphatWallFunction;
value uniform 0;
}
}
}
epsilon
{
boundaryField
{
"region0_to_.*"
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
}
}
k
{
boundaryField
{
"region0_to_.*"
{
type compressible::kqRWallFunction;
value uniform 0.01;
}
}
}
mut
{
boundaryField
{
"region0_to_.*"
{
type mutkWallFunction;
value uniform 0.0;
}
}
}
p
{
boundaryField
{
"region0_to_.*"
{
type calculated;
value $internalField;
}
}
}
p_rgh
{
boundaryField
{
"region0_to_.*"
{
type fixedFluxPressure;
value $internalField;
}
}
}
T
{
boundaryField
{
"region0_to.*"
{
type compressible::thermalBaffle;
// Coupled BC.
Tnbr T;
kappa fluidThermo;
kappaName none;
QrNbr none;
Qr none;
// Thermo baffle model
thermalBaffleModel thermalBaffle;
regionName baffleRegion;
infoOutput no;
active yes;
thermalBaffleCoeffs
{
}
// Solid thermo
thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa 0.01;
}
thermodynamics
{
Hf 0;
Cp 15;
}
equationOfState
{
rho 80;
}
}
radiation
{
radiationModel opaqueSolid;
absorptionEmissionModel none;
scatterModel none;
}
value uniform 300;
}
}
}
U
{
boundaryField
{
"region0_to_.*"
{
type fixedValue;
value uniform (0 0 0);
}
}
}
}
// ************************************************************************* //

View File

@ -19,109 +19,100 @@ FoamFile
// faces.
internalFacesOnly true;
// Baffles to create.
baffles
{
baffleFacesThermoBaffle1D
{
//- Use predefined faceZone to select faces and orientation.
type faceZone;
zoneName baffleFaces;
type searchableSurface;
surface triSurfaceMesh;
name baffle1D.stl;
patches
{
master
{
//- Master side patch
name baffle1Wall_0;
type mappedWall;
sampleMode nearestPatchFace;
samplePatch baffle1Wall_1;
offset (0 0 0);
name baffle1DWall_master;
type wall;
inGroups (baffleWallGroup);
patchFields
{
T
{
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
baffleActivated yes;
thickness uniform 0.005; // thickness [m]
Qs uniform 100; // heat flux [W/m2]
specie
{
nMoles 1;
molWeight 20;
}
transport
{
kappa 1;
}
thermodynamics
{
Hf 0;
Cp 10;
}
equationOfState
{
rho 10;
}
value uniform 300;
}
alphat
{
type compressible::alphatWallFunction;
value uniform 0;
}
epsilon
{
type compressible::epsilonWallFunction;
value uniform 0.01;
}
k
{
type compressible::kqRWallFunction;
value uniform 0.01;
}
mut
{
type mutkWallFunction;
value uniform 0;
}
p
{
type calculated;
value uniform 101325;
}
p_rgh
{
type fixedFluxPressure;
}
U
{
type fixedValue;
value uniform (0 0 0);
}
#include "./0/include/wallBafflePatches"
#include "./0/include/1DBaffle/1DTemperatureMasterBafflePatches"
}
}
slave
{
//- Slave side patch
name baffle1Wall_1;
name baffle1DWall_slave;
type wall;
inGroups (baffleWallGroup);
patchFields
{
#include "./0/include/wallBafflePatches"
#include "./0/include/1DBaffle/1DTemperatureSlaveBafflePatches"
}
}
}
}
#include "./0/include/baffle3DSetup"
baffleFacesThermoBaffle3D
{
type searchableSurface;
surface triSurfaceMesh;
name baffle3D.stl;
patches
{
master
{
//- Master side patch
name ${masterPatchName};
type mappedWall;
type interRegionMappedWallGenerator;
inGroups (baffleWallGroup);
sampleMode nearestPatchFace;
samplePatch baffle1Wall_0;
sampleRegion ${baffleRegionName};
samplePatch bottom;
offsetMode uniform;
offset (0 0 0);
patchFields
{
${...master.patchFields}
#include "./0/include/wallBafflePatches"
#include "./0/include/3DBaffle/3DTemperatureMasterBafflePatches"
}
}
slave
{
//- Slave side patch
name ${slavePatchName};
type mappedWall;
inGroups (baffleWallGroup);
sampleMode nearestPatchFace;
sampleRegion ${baffleRegionName};
samplePatch top;
offsetMode uniform;
offset (0 0 0);
patchFields
{
#include "./0/include/wallBafflePatches"
#include "./0/include/3DBaffle/3DTemperatureSlaveBafflePatches"
}
}
}

View File

@ -27,7 +27,6 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss limitedLinear 0.2;
div(phi,K) bounded Gauss limitedLinear 0.2;
div(phi,h) bounded Gauss limitedLinear 0.2;
@ -39,7 +38,13 @@ divSchemes
laplacianSchemes
{
default Gauss linear uncorrected;
default none;
laplacian(muEff,U) Gauss linear uncorrected;
laplacian(rhorAUf,p_rgh) Gauss linear uncorrected;
laplacian(alphaEff,h) Gauss linear uncorrected;
laplacian(DkEff,k) Gauss linear uncorrected;
laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
laplacian(DomegaEff,omega) Gauss linear uncorrected;
}
interpolationSchemes

View File

@ -49,9 +49,9 @@ SIMPLE
residualControl
{
p_rgh 5e-3;
U 3e-4;
h 3e-4;
p_rgh 1e-3;
U 1e-4;
h 1e-4;
// possibly check turbulence fields
"(k|epsilon|omega)" 5e-3;
@ -62,8 +62,8 @@ relaxationFactors
{
rho 1.0;
p_rgh 0.7;
U 0.7;
h 0.3;
U 0.3;
h 0.7;
"(k|epsilon|omega)" 0.3;
}

View File

@ -1,89 +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 dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name baffleFaces;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.296 0 0) (0.306 0.18 2);
}
}
{
name baffleFacesSlaveCells;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (0 0 0) (0.295 0.2 2);
}
}
{
name baffleFaces;
type faceZoneSet;
action new;
source setsToFaceZone;
sourceInfo
{
faceSet baffleFaces;
cellSet baffleFacesSlaveCells;
}
}
{
name baffleFaces2;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.5944 0 0) (0.605 0.18 2);
}
}
{
name baffleFacesSlaveCells2;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (0 0 0) (0.594 0.2 2);
}
}
{
name baffleFaces2;
type faceZoneSet;
action new;
source setsToFaceZone;
sourceInfo
{
faceSet baffleFaces2;
cellSet baffleFacesSlaveCells2;
}
}
);
// ************************************************************************* //