mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: mapDistribute on radiation BC and changes on
reactingParcelFilPyrolysisFoam
This commit is contained in:
@ -9,7 +9,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/combustionModels/lnInclude \
|
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
|||||||
@ -9,6 +9,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
|
radiation->correct();
|
||||||
combustion->correct();
|
combustion->correct();
|
||||||
dQ = combustion->dQ();
|
dQ = combustion->dQ();
|
||||||
label inertIndex = -1;
|
label inertIndex = -1;
|
||||||
@ -65,7 +66,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|
||||||
radiation->correct();
|
//radiation->correct();
|
||||||
|
|
||||||
Info<< "min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
|
Info<< "min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "mapDistribute.H"
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "basicReactingCloud.H"
|
#include "basicReactingCloud.H"
|
||||||
@ -54,9 +55,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createClouds.H"
|
#include "createClouds.H"
|
||||||
#include "createRadiationModel.H"
|
|
||||||
#include "createSurfaceFilmModel.H"
|
#include "createSurfaceFilmModel.H"
|
||||||
#include "createPyrolysisModel.H"
|
#include "createPyrolysisModel.H"
|
||||||
|
#include "createRadiationModel.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
@ -111,10 +112,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
runTime.write();
|
||||||
runTime.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
|||||||
@ -189,6 +189,8 @@ updateCoeffs()
|
|||||||
|
|
||||||
ray.Qr().boundaryField()[patchI] += Iw*(n & ray.dAve());
|
ray.Qr().boundaryField()[patchI] += Iw*(n & ray.dAve());
|
||||||
|
|
||||||
|
scalarList temissivity = emissivity();
|
||||||
|
|
||||||
forAll(Iw, faceI)
|
forAll(Iw, faceI)
|
||||||
{
|
{
|
||||||
scalar Ir = 0.0;
|
scalar Ir = 0.0;
|
||||||
@ -217,8 +219,8 @@ updateCoeffs()
|
|||||||
valueFraction()[faceI] = 1.0;
|
valueFraction()[faceI] = 1.0;
|
||||||
refValue()[faceI] =
|
refValue()[faceI] =
|
||||||
(
|
(
|
||||||
Ir*(scalar(1.0) - emissivity()()[faceI])
|
Ir*(scalar(1.0) - temissivity[faceI])
|
||||||
+ emissivity()()[faceI]*physicoChemical::sigma.value()
|
+ temissivity[faceI]*physicoChemical::sigma.value()
|
||||||
* pow4(Tp[faceI])
|
* pow4(Tp[faceI])
|
||||||
)/pi;
|
)/pi;
|
||||||
|
|
||||||
@ -238,7 +240,6 @@ updateCoeffs()
|
|||||||
Iw[faceI]*(n[faceI] & ray.dAve());
|
Iw[faceI]*(n[faceI] & ray.dAve());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mixedFvPatchScalarField::updateCoeffs();
|
mixedFvPatchScalarField::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ Foam::radiationCoupledBase::radiationCoupledBase
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::radiationCoupledBase::emissivity() const
|
Foam::scalarField Foam::radiationCoupledBase::emissivity() const
|
||||||
{
|
{
|
||||||
switch (method_)
|
switch (method_)
|
||||||
{
|
{
|
||||||
@ -142,6 +142,9 @@ Foam::tmp<Foam::scalarField> Foam::radiationCoupledBase::emissivity() const
|
|||||||
|
|
||||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
const polyMesh& nbrMesh = mpp.sampleMesh();
|
||||||
|
|
||||||
|
// Force recalculation of mapping and schedule
|
||||||
|
const mapDistribute& distMap = mpp.map();
|
||||||
|
|
||||||
const fvPatch& nbrPatch = refCast<const fvMesh>
|
const fvPatch& nbrPatch = refCast<const fvMesh>
|
||||||
(
|
(
|
||||||
nbrMesh
|
nbrMesh
|
||||||
@ -160,12 +163,11 @@ Foam::tmp<Foam::scalarField> Foam::radiationCoupledBase::emissivity() const
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
scalarField& emissivity = temissivity();
|
scalarField emissivity(temissivity);
|
||||||
|
|
||||||
// Use direct map mapping to exchange data
|
// Use direct map mapping to exchange data
|
||||||
mpp.map().distribute(emissivity);
|
distMap.distribute(emissivity);
|
||||||
|
//Pout << emissivity << endl;
|
||||||
return temissivity;
|
return emissivity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -114,7 +114,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Calculate corresponding emissivity field
|
//- Calculate corresponding emissivity field
|
||||||
tmp<scalarField> emissivity() const;
|
scalarField emissivity() const;
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
void write(Ostream&) const;
|
void write(Ostream&) const;
|
||||||
|
|||||||
@ -189,6 +189,8 @@ updateCoeffs()
|
|||||||
dom.blackBody().bLambda(lambdaId).boundaryField()[patchI]
|
dom.blackBody().bLambda(lambdaId).boundaryField()[patchI]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
scalarList temissivity = emissivity();
|
||||||
|
|
||||||
forAll(Iw, faceI)
|
forAll(Iw, faceI)
|
||||||
{
|
{
|
||||||
scalar Ir = 0.0;
|
scalar Ir = 0.0;
|
||||||
@ -215,8 +217,8 @@ updateCoeffs()
|
|||||||
valueFraction()[faceI] = 1.0;
|
valueFraction()[faceI] = 1.0;
|
||||||
refValue()[faceI] =
|
refValue()[faceI] =
|
||||||
(
|
(
|
||||||
Ir*(1.0 - emissivity()()[faceI])
|
Ir*(1.0 - temissivity[faceI])
|
||||||
+ emissivity()()[faceI]*Eb[faceI]
|
+ temissivity[faceI]*Eb[faceI]
|
||||||
)/pi;
|
)/pi;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -158,6 +158,9 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
|||||||
const fvPatch& nbrPatch =
|
const fvPatch& nbrPatch =
|
||||||
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
|
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
|
||||||
|
|
||||||
|
// Force recalculation of mapping and schedule
|
||||||
|
const mapDistribute& distMap = mpp.map();
|
||||||
|
|
||||||
scalarField Tc(patchInternalField());
|
scalarField Tc(patchInternalField());
|
||||||
scalarField& Tp = *this;
|
scalarField& Tp = *this;
|
||||||
|
|
||||||
@ -170,13 +173,13 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
// Swap to obtain full local values of neighbour internal field
|
// Swap to obtain full local values of neighbour internal field
|
||||||
scalarField TcNbr(nbrField.patchInternalField());
|
scalarField TcNbr(nbrField.patchInternalField());
|
||||||
|
distMap.distribute(TcNbr);
|
||||||
|
|
||||||
mpp.map().distribute(TcNbr);
|
|
||||||
|
|
||||||
// Swap to obtain full local values of neighbour K*delta
|
// Swap to obtain full local values of neighbour K*delta
|
||||||
scalarField KDeltaNbr(nbrField.K(TcNbr)*nbrPatch.deltaCoeffs());
|
scalarField KDeltaNbr(nbrField.K(nbrField)*nbrPatch.deltaCoeffs());
|
||||||
|
distMap.distribute(KDeltaNbr);
|
||||||
|
|
||||||
mpp.map().distribute(KDeltaNbr);
|
|
||||||
|
|
||||||
scalarField KDelta(K(*this)*patch().deltaCoeffs());
|
scalarField KDelta(K(*this)*patch().deltaCoeffs());
|
||||||
|
|
||||||
@ -190,7 +193,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
|||||||
if (QrNbrName_ != "none")
|
if (QrNbrName_ != "none")
|
||||||
{
|
{
|
||||||
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
|
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
|
||||||
mpp.map().distribute(QrNbr);
|
distMap.distribute(QrNbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);
|
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);
|
||||||
|
|||||||
@ -1,58 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class polyBoundaryMesh;
|
|
||||||
location "constant/polyMesh";
|
|
||||||
object boundary;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
6
|
|
||||||
(
|
|
||||||
maxY
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 300;
|
|
||||||
startFace 8300;
|
|
||||||
}
|
|
||||||
minX
|
|
||||||
{
|
|
||||||
type patch;
|
|
||||||
nFaces 100;
|
|
||||||
startFace 8600;
|
|
||||||
}
|
|
||||||
maxX
|
|
||||||
{
|
|
||||||
type patch;
|
|
||||||
nFaces 100;
|
|
||||||
startFace 8700;
|
|
||||||
}
|
|
||||||
minY
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 300;
|
|
||||||
startFace 8800;
|
|
||||||
}
|
|
||||||
minZ
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 300;
|
|
||||||
startFace 9100;
|
|
||||||
}
|
|
||||||
maxZ
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 300;
|
|
||||||
startFace 9400;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user