Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Andrew Heather 2023-11-14 17:52:28 +00:00
commit 6ea2041122
9 changed files with 94 additions and 70 deletions

View File

@ -1,23 +1,23 @@
## Getting the code
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2212:
Links to all code packs are available on https://dl.openfoam.com. For OpenFOAM-v2306:
- https://dl.openfoam.com/source/latest/
- Source: https://dl.openfoam.com/source/v2212/OpenFOAM-v2212.tgz
- ThirdParty: https://dl.openfoam.com/source/v2212/ThirdParty-v2212.tgz
- Source: https://dl.openfoam.com/source/v2306/OpenFOAM-v2306.tgz
- ThirdParty: https://dl.openfoam.com/source/v2306/ThirdParty-v2306.tgz
## OpenFOAM® Quick Build Guide
Prior to building, ensure that the [system requirements][link openfoam-require]
are satisfied (including any special [cross-compiling][wiki-cross-compile]
considerations), and source the correct OpenFOAM environment.
For example, for the OpenFOAM-v2212 version:
For example, for the OpenFOAM-v2306 version:
```
source <installation path>/OpenFOAM-v2212/etc/bashrc
source <installation path>/OpenFOAM-v2306/etc/bashrc
```
e.g. if installed under the `~/openfoam` directory
```
source ~/openfoam/OpenFOAM-v2212/etc/bashrc
source ~/openfoam/OpenFOAM-v2306/etc/bashrc
```
@ -157,4 +157,4 @@ More details in the [ThirdParty build guide][link third-build].
[wiki-config]: https://develop.openfoam.com/Development/openfoam/-/wikis/configuring
---
Copyright 2019-2022 OpenCFD Ltd
Copyright 2019-2023 OpenCFD Ltd

View File

@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com
export WM_PROJECT_VERSION=com
export WM_PROJECT_VERSION=v2306
#------------------------------------------------------------------------------
# Configuration environment variables.

View File

@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com
setenv WM_PROJECT_VERSION com
setenv WM_PROJECT_VERSION v2306
#------------------------------------------------------------------------------
# Configuration environment variables.

View File

@ -96,7 +96,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
this->coeffDict().subDict("sizeDistribution"), owner.rndGen()
)
),
nInjected_(this->parcelsAddedTotal()),
nInjected_(Pstream::master() ? this->parcelsAddedTotal() : 0),
injectorOrder_(identity(positionAxis_.size())),
tanVec1_(),
tanVec2_()
@ -233,7 +233,7 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
const label targetParcels =
ceil(positionAxis_.size()*parcelsPerInjector_*volumeFraction);
return targetParcels - nInjected_;
return targetParcels - returnReduce(nInjected_, sumOp<label>());
}
return 0;

View File

@ -614,6 +614,12 @@ void Foam::advancingFrontAMI::write(Ostream& os) const
faceAreaIntersect::triangulationModeNames_[faceAreaIntersect::tmMesh],
faceAreaIntersect::triangulationModeNames_[triMode_]
);
os.writeEntryIfDifferent<word>
(
"areaNormalisationMode",
areaNormalisationModeNames_[areaNormalisationMode::project],
areaNormalisationModeNames_[areaNormalisationMode_]
);
}

View File

@ -382,8 +382,8 @@ void Foam::cyclicAMIPolyPatch::resetAMI(const UList<point>& points) const
}
const cyclicAMIPolyPatch& nbr = neighbPatch();
pointField srcPoints(localPoints());
pointField nbrPoints(nbr.localPoints());
const pointField srcPoints(points, meshPoints());
pointField nbrPoints(points, nbr.meshPoints());
Info<< "AMI: Creating AMI for source:" << name()
<< " and target:" << nbr.name() << endl;

View File

@ -6,7 +6,11 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
<<<<<<< HEAD
Copyright (C) 2019-2023 OpenCFD Ltd.
=======
Copyright (C) 2019-202i3 OpenCFD Ltd.
>>>>>>> origin/master
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,8 +42,7 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModelType&
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
filmModel() const
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModel() const
{
typedef filmModelType ModelType;
@ -73,8 +76,7 @@ filmModel() const
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
pyrolysisModelType&
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
pyrModel() const
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::pyrModel() const
{
typedef pyrolysisModelType ModelType;
@ -90,7 +92,7 @@ pyrModel() const
return mdl;
}
}
DynamicList<word> modelNames(models.size());
for (const ModelType& mdl : models)
{
@ -241,13 +243,9 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::rmap
{
mixedFvPatchScalarField::rmap(ptf, addr);
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& tiptf =
refCast
<
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
>(ptf);
const auto& fpptf = refCast<const myType>(ptf);
temperatureCoupledBase::rmap(tiptf, addr);
temperatureCoupledBase::rmap(fpptf, addr);
}
@ -259,8 +257,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
}
// Get the coupling information from the mappedPatchBase
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const auto& mpp = refCast<const mappedPatchBase>(patch().patch());
const label patchi = patch().index();
const label nbrPatchi = mpp.samplePolyPatch().index();
@ -272,10 +269,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField intFld(patchInternalField());
const auto& nbrField =
refCast
<
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
>
refCast<const myType>
(
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
);
@ -293,7 +287,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField KDeltaNbr(nbrK*nbrPatch.deltaCoeffs());
mpp.distribute(KDeltaNbr);
scalarField myKDelta(K*patch().deltaCoeffs());
const scalarField myKDelta(K*patch().deltaCoeffs());
scalarList Tfilm(patch().size(), Zero);
scalarList htcwfilm(patch().size(), Zero);
@ -306,22 +300,78 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField qr(patch().size(), Zero);
label coupledPatchi = -1;
label filmPatchi = -1;
if (pyrolysisRegionName_ == mesh.name())
{
// Working on the pyrolysis mesh
coupledPatchi = patchi;
if (qrName_ != "none")
{
qr = nbrPatch.lookupPatchField<volScalarField>(qrName_);
mpp.distribute(qr);
}
filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
// Obtain htcw
htcwfilm =
pyrolysis.mapRegionPatchField
(
film,
coupledPatchi,
filmPatchi,
htcw,
true
);
// Obtain Tfilm at the boundary through Ts.
// NOTE: Tf is not good as at the boundary it will retrieve Tp
const scalarField Ts(film.Ts().boundaryField()[filmPatchi]);
Tfilm =
pyrolysis.mapRegionPatchField
(
film,
coupledPatchi,
filmPatchi,
Ts,
true
);
// Obtain delta
filmDelta =
pyrolysis.mapRegionPatchField<scalar>
(
film,
"deltaf",
coupledPatchi,
true
);
}
else if (pyrolysis.primaryMesh().name() == mesh.name())
{
// Working on the primary mesh
coupledPatchi = nbrPatch.index();
if (qrName_ != "none")
{
qr = patch().lookupPatchField<volScalarField>(qrName_);
}
filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
htcwfilm = film.htcw().h()().boundaryField()[filmPatchi];
film.toPrimary(filmPatchi, htcwfilm);
// Obtain Tfilm at the boundary through Ts.
// NOTE: Tf is not good as at the boundary it will retrieve Tp
Tfilm = film.Ts().boundaryField()[filmPatchi];
film.toPrimary(filmPatchi, Tfilm);
filmDelta = film.delta().boundaryField()[filmPatchi];
film.toPrimary(filmPatchi, filmDelta);
}
else
{
@ -331,39 +381,8 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
<< exit(FatalError);
}
const label filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
// Obtain htcw
htcwfilm =
pyrolysis.mapRegionPatchField
(
film,
coupledPatchi,
filmPatchi,
htcw,
true
);
// Obtain Tfilm at the boundary through Ts.
// NOTE: Tf is not good as at the boundary it will retrieve Tp
Tfilm = film.Ts().boundaryField()[filmPatchi];
film.toPrimary(filmPatchi, Tfilm);
// Obtain delta
filmDelta =
pyrolysis.mapRegionPatchField<scalar>
(
film,
"deltaf",
coupledPatchi,
true
);
// Estimate wetness of the film (1: wet , 0: dry)
scalarField ratio
const scalarField ratio
(
min
(
@ -376,14 +395,11 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
)
);
scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
scalarField qRad((1.0 - ratio)*qr);
scalarField alpha(KDeltaNbr - (qRad + qConv)/Tp);
const scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
const scalarField qRad((1.0 - ratio)*qr);
const scalarField alpha(KDeltaNbr - (qRad + qConv)/Tp);
valueFraction() = alpha/(alpha + (1.0 - ratio)*myKDelta);
refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/alpha;
mixedFvPatchScalarField::updateCoeffs();

View File

@ -110,6 +110,8 @@ public:
typedef Foam::regionModels::pyrolysisModels::pyrolysisModel
pyrolysisModelType;
typedef filmPyrolysisRadiativeCoupledMixedFvPatchScalarField myType;
private:

View File

@ -19,7 +19,7 @@ solvers
"pcorr.*"
{
solver GAMG;
smoother GaussSeidel;
smoother DICGaussSeidel;
cacheAgglomeration no;
tolerance 0.02;
relTol 0;