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

This commit is contained in:
Mark Olesen 2022-06-03 14:11:00 +02:00
commit 264c09c365
18 changed files with 73 additions and 38 deletions

View File

@ -671,7 +671,7 @@ int main(int argc, char *argv[])
{
for
(
const word& opt
const char * const opt
: { "cellSet", "cellZone", "faceSet", "pointSet" }
)
{

View File

@ -92,7 +92,7 @@ bool setCellFieldType
fieldType field(fieldHeader, mesh, false);
const Type& value = pTraits<Type>(fieldValueStream);
const Type value = pTraits<Type>(fieldValueStream);
if (selectedCells.size() == field.size())
{
@ -244,7 +244,7 @@ bool setFaceFieldType
fieldType field(fieldHeader, mesh);
const Type& value = pTraits<Type>(fieldValueStream);
const Type value = pTraits<Type>(fieldValueStream);
// Create flat list of selected faces and their value.
Field<Type> allBoundaryValues(mesh.nBoundaryFaces());

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2021 OpenCFD Ltd.
# Copyright (C) 2018-2022 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -210,8 +210,8 @@ endif
# Remove duplicates from environment paths
_foamClean PATH "$foamOldDirs"
_foamClean MANPATH "$foamOldDirs"
_foamClean PATH
_foamClean MANPATH
_foamClean -lib
# Add trailing ':' for system manpages

View File

@ -28,6 +28,8 @@ License
#include "MathFunctions.H"
#include "mathematicalConstants.H"
#include "error.H"
#include <cmath>
#include <limits>
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * //

View File

@ -36,6 +36,7 @@ Description
#include "mathematicalConstants.H"
#include "error.H"
#include <cmath>
#include <limits>
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //

View File

@ -35,6 +35,8 @@ Description
#include "MathFunctions.H"
#include "mathematicalConstants.H"
#include "error.H"
#include <cmath>
#include <limits>
using namespace Foam::constant::mathematical;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2020,2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -135,7 +135,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::autoMap
const fvPatchFieldMapper& m
)
{
scalarField::autoMap(m);
mixedFvPatchField<scalar>::autoMap(m);
}

View File

@ -264,6 +264,7 @@ void RNGkEpsilon<BasicTurbulenceModel>::correct()
tmp<volTensorField> tgradU = fvc::grad(U);
const volScalarField::Internal GbyNu
(
this->type() + ":GbyNu",
tgradU().v() && dev(twoSymm(tgradU().v()))
);
tgradU.clear();

View File

@ -115,10 +115,10 @@ atmBoundaryLayer::atmBoundaryLayer(const atmBoundaryLayer& abl)
ppMin_(abl.ppMin_),
time_(abl.time_),
patch_(abl.patch_),
flowDir_(abl.flowDir_),
zDir_(abl.zDir_),
Uref_(abl.Uref_),
Zref_(abl.Zref_),
flowDir_(abl.flowDir_.clone()),
zDir_(abl.zDir_.clone()),
Uref_(abl.Uref_.clone()),
Zref_(abl.Zref_.clone()),
z0_(abl.z0_.clone(patch_)),
d_(abl.d_.clone(patch_))
{}
@ -274,10 +274,22 @@ void atmBoundaryLayer::write(Ostream& os) const
os.writeEntry("Cmu", Cmu_);
os.writeEntry("C1", C1_);
os.writeEntry("C2", C2_);
flowDir_->writeData(os);
zDir_->writeData(os);
Uref_->writeData(os);
Zref_->writeData(os);
if (flowDir_)
{
flowDir_->writeData(os);
}
if (zDir_)
{
zDir_->writeData(os);
}
if (Uref_)
{
Uref_->writeData(os);
}
if (Zref_)
{
Zref_->writeData(os);
}
if (z0_)
{
z0_->writeData(os) ;

View File

@ -166,7 +166,7 @@ atmAlphatkWallFunctionFvPatchScalarField
fixedValueFvPatchScalarField(wfpsf),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
Pr_(wfpsf.Pr_),
Pr_(wfpsf.Pr_.clone()),
Prt_(wfpsf.Prt_.clone(this->patch().patch())),
z0_(wfpsf.z0_.clone(this->patch().patch()))
{
@ -184,7 +184,7 @@ atmAlphatkWallFunctionFvPatchScalarField
fixedValueFvPatchScalarField(wfpsf, iF),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
Pr_(wfpsf.Pr_),
Pr_(wfpsf.Pr_.clone()),
Prt_(wfpsf.Prt_.clone(this->patch().patch())),
z0_(wfpsf.z0_.clone(this->patch().patch()))
{

View File

@ -161,38 +161,38 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::indexPairs()
void Foam::turbulentDigitalFilterInletFvPatchVectorField::checkR() const
{
const vectorField& faceCentres = this->patch().patch().faceCentres();
label badFacei = -1;
forAll(R_, facei)
{
if (R_[facei].xx() <= 0)
{
badFacei = facei;
FatalErrorInFunction
<< "Reynolds stress tensor component Rxx cannot be negative"
<< " or zero, where Rxx = " << R_[facei].xx()
<< " at the face centre = " << faceCentres[facei]
<< exit(FatalError);
<< " or zero, where Rxx = " << R_[facei].xx();
break;
}
if (R_[facei].yy() < 0 || R_[facei].zz() < 0)
{
badFacei = facei;
FatalErrorInFunction
<< "Reynolds stress tensor components Ryy or Rzz cannot be"
<< " negative where Ryy = " << R_[facei].yy()
<< ", and Rzz = " << R_[facei].zz()
<< " at the face centre = " << faceCentres[facei]
<< exit(FatalError);
<< ", and Rzz = " << R_[facei].zz();
break;
}
const scalar x0 = R_[facei].xx()*R_[facei].yy() - sqr(R_[facei].xy());
if (x0 <= 0)
{
badFacei = facei;
FatalErrorInFunction
<< "Reynolds stress tensor component group, Rxx*Ryy - Rxy^2"
<< " cannot be negative or zero"
<< " at the face centre = " << faceCentres[facei]
<< exit(FatalError);
<< " cannot be negative or zero";
break;
}
const scalar x1 = R_[facei].zz() - sqr(R_[facei].xz())/R_[facei].xx();
@ -202,15 +202,23 @@ void Foam::turbulentDigitalFilterInletFvPatchVectorField::checkR() const
if (x3 < 0)
{
badFacei = facei;
FatalErrorInFunction
<< "Reynolds stress tensor component group, "
<< "Rzz - Rxz^2/Rxx - (Ryz - Rxy*Rxz/(Rxx*(Rxx*Ryy - Rxy^2)))^2"
<< " cannot be negative at the face centre = "
<< faceCentres[facei]
<< exit(FatalError);
<< " cannot be negative";
break;
}
}
if (badFacei >= 0)
{
FatalError
<< " at the face centre = "
<< this->patch().patch().faceCentres()[badFacei]
<< exit(FatalError);
}
Info<< " # Reynolds stress tensor on patch is consistent #" << endl;
}

View File

@ -79,7 +79,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
const vectorField nf(patch.nf());
const vectorField faceCellCentres(patch.patch().faceCellCentres());
const labelUList& faceCells = patch.patch().faceCells();
const vectorField::subField& faceCentres = patch.patch().faceCentres();
const vectorField::subField faceCentres = patch.patch().faceCentres();
forAll(patch, patchFacei)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -159,7 +159,7 @@ Foam::scalar Foam::ManualInjection<CloudType>::timeEnd() const
{
// Injection is instantaneous - but allow for a finite interval to
// avoid numerical issues when interval is zero
return ROOTVSMALL;
return this->SOI_ + SMALL;
}

View File

@ -294,6 +294,7 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
// Add child parcel as copy of parent
SprayParcel<ParcelType>* child = new SprayParcel<ParcelType>(*this);
child->origId() = this->getNewParticleID();
child->origProc() = Pstream::myProcNo();
child->d() = dChild;
child->d0() = dChild;
const scalar massChild = child->mass();

View File

@ -37,7 +37,7 @@ Description
Typical use might be to e.g. average face centres to points on a patch
const labelListList& pointFaces = pp.pointFaces();
const pointField& faceCentres = pp.faceCentres();
const vectorField::subField faceCentres = pp.faceCentres();
Field<weightedPosition> avgBoundary(pointFaces.size());

View File

@ -436,7 +436,15 @@ Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
Foam::basicThermo::~basicThermo()
{
db().checkOut("p");
if (pOwner_)
{
db().checkOut(p_.name());
}
if (TOwner_)
{
db().checkOut(T_.name());
}
}

View File

@ -136,7 +136,7 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs)
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
const pointField& cf = pp.faceCentres();
const vectorField::subField cf = pp.faceCentres();
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
{

View File

@ -155,7 +155,7 @@ void Foam::faceShading::calculate()
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
const pointField& cf = pp.faceCentres();
const vectorField::subField cf = pp.faceCentres();
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
{