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.
@ -45,24 +45,27 @@ Description
\verbatim \verbatim
formatOptions formatOptions
{ {
// Apply colours flag (yes | no ) [optional] gltf
colours yes;
// List of options per field
fieldInfo
{ {
p // Apply colours flag (yes | no ) [optional]
colour yes;
// List of options per field
fieldInfo
{ {
// Colour map [optional] p
colourMap <colourMap>; {
// Colour map [optional]
colourMap <colourMap>;
// Colour map minimum and maximum limits [optional] // Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified // Uses field min and max if not specified
min 0; min 0;
max 1; max 1;
// Alpha channel [optional] (<scalar>) // Alpha channel [optional] (<scalar>)
alpha 0.5; alpha 0.5;
}
} }
} }
} }
@ -73,35 +76,38 @@ Description
\verbatim \verbatim
formatOptions formatOptions
{ {
// Apply colours flag (yes | no) [optional] gltf
colours yes;
// Animate tracks (yes | no) [optional]
animate yes;
// Animation properties [optional]
animationInfo
{ {
// Colour map [optional] // Apply colours flag (yes | no) [optional]
colourMap <colourMap>; colour yes;
// Colour [optional] (<vector> | uniform | field) // Animate tracks (yes | no) [optional]
colour (1 0 0); // RGB in range [0-1] animate yes;
//colour uniform; // Animation properties [optional]
//colourValue (1 0 0); // RGB in range [0-1] animationInfo
{
// Colour map [optional]
colourMap <colourMap>;
//colour field; // Colour [optional] (<vector> | uniform | field)
//colourField d; colour (1 0 0); // RGB in range [0-1]
// Colour map minimum and maximum limits [optional] //colour uniform;
// Note: for colour = field option //colourValue (1 0 0); // RGB in range [0-1]
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (<scalar>) //colour field;
alpha 0.5; //colourField d;
// Colour map minimum and maximum limits [optional]
// Note: for colour = field option
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
}
} }
} }
\endverbatim \endverbatim

View File

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