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

This commit is contained in:
Andrew Heather
2024-06-18 17:09:58 +01:00
5 changed files with 64 additions and 56 deletions

View File

@ -43,7 +43,7 @@ Type Foam::functionObjects::extractEulerianParticles::faceValue
{ {
label patchi = patchIDs_[localFacei]; label patchi = patchIDs_[localFacei];
label pFacei = patchFaceIDs_[localFacei]; label pFacei = patchFaceIDs_[localFacei];
if (patchi != 0) if (patchi != -1)
{ {
return field.boundaryField()[patchi][pFacei]; return field.boundaryField()[patchi][pFacei];
} }

View File

@ -302,7 +302,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
TFilmPatch_ = film.Tf().primitiveField(); TFilmPatch_ = film.Tf().primitiveField();
// Direct copy (one-to-one mapping) // Direct copy (one-to-one mapping)
TFilmPatch_ = film.Cp().primitiveField(); CpFilmPatch_ = film.Cp().primitiveField();
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd. Copyright (C) 2021-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -70,7 +70,7 @@ static tmp<vectorField> getBoundedColours
const scalar boundMax const scalar boundMax
) )
{ {
const label boundDelta = (boundMax - boundMin + ROOTVSMALL); const scalar boundDelta = (boundMax - boundMin + ROOTVSMALL);
auto tresult = tmp<vectorField>::New(field.size()); auto tresult = tmp<vectorField>::New(field.size());
auto& result = tresult.ref(); auto& result = tresult.ref();
@ -167,7 +167,7 @@ Foam::scalarMinMax Foam::coordSetWriters::gltfWriter::getFieldLimits
{ {
const dictionary fieldDict = fieldInfoDict_.subOrEmptyDict(fieldName); const dictionary fieldDict = fieldInfoDict_.subOrEmptyDict(fieldName);
scalarMinMax limits; scalarMinMax limits(-GREAT, GREAT);
fieldDict.readIfPresent("min", limits.min()); fieldDict.readIfPresent("min", limits.min());
fieldDict.readIfPresent("max", limits.max()); fieldDict.readIfPresent("max", limits.max());
@ -191,7 +191,7 @@ Foam::coordSetWriters::gltfWriter::getAlphaField
{ {
// Not specified // Not specified
} }
else if (!eptr->stream().peek().isString()) else if (!eptr->stream().peek().isWord())
{ {
// Value specified // Value specified

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd. Copyright (C) 2021-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,9 +44,11 @@ Description
\verbatim \verbatim
formatOptions formatOptions
{
gltf
{ {
// Apply colours flag (yes | no ) [optional] // Apply colours flag (yes | no ) [optional]
colours yes; colour yes;
// List of options per field // List of options per field
fieldInfo fieldInfo
@ -66,15 +68,18 @@ Description
} }
} }
} }
}
\verbatim \verbatim
For particle tracks: For particle tracks:
\verbatim \verbatim
formatOptions formatOptions
{
gltf
{ {
// Apply colours flag (yes | no) [optional] // Apply colours flag (yes | no) [optional]
colours yes; colour yes;
// Animate tracks (yes | no) [optional] // Animate tracks (yes | no) [optional]
animate yes; animate yes;
@ -104,6 +109,7 @@ Description
alpha 0.5; alpha 0.5;
} }
} }
}
\endverbatim \endverbatim
Note Note

View File

@ -419,20 +419,22 @@ void Foam::incompressibleAdjointSolver::accumulateBCSensitivityIntegrand
{ {
fvPatchVectorField& Uab = UaBoundary[patchI]; fvPatchVectorField& Uab = UaBoundary[patchI];
if (isA<adjointVectorBoundaryCondition>(Uab)) if (isA<adjointVectorBoundaryCondition>(Uab))
{
tmp<tensorField> dxdbMult =
refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult();
if (dxdbMult)
{ {
const fvPatch& patch = mesh_.boundary()[patchI]; const fvPatch& patch = mesh_.boundary()[patchI];
tmp<vectorField> tnf = patch.nf(); tmp<vectorField> tnf = patch.nf();
const scalarField& magSf = patch.magSf(); const scalarField& magSf = patch.magSf();
tmp<vectorField> DvDbMult = tmp<vectorField> DvDbMult =
nuEffBoundary[patchI]*(Uab.snGrad() + (gradUabf[patchI] & tnf)) nuEffBoundary[patchI]
*(Uab.snGrad() + (gradUabf[patchI] & tnf))
// - (nf*pa.boundaryField()[patchI]) // - (nf*pa.boundaryField()[patchI])
+ adjointTurbulence().adjointMomentumBCSource()[patchI]; + adjointTurbulence().adjointMomentumBCSource()[patchI];
bcDxDbMult()[patchI] += bcDxDbMult()[patchI] += (DvDbMult & dxdbMult())*magSf*dt;
( }
DvDbMult
& refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult()
)*magSf*dt;
} }
} }
} }