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

This commit is contained in:
Andrew Heather 2024-06-18 17:09:58 +01:00
commit ac099d82eb
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 pFacei = patchFaceIDs_[localFacei];
if (patchi != 0)
if (patchi != -1)
{
return field.boundaryField()[patchi][pFacei];
}

View File

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

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2022 OpenCFD Ltd.
Copyright (C) 2021-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,24 +45,27 @@ Description
\verbatim
formatOptions
{
// Apply colours flag (yes | no ) [optional]
colours yes;
// List of options per field
fieldInfo
gltf
{
p
// Apply colours flag (yes | no ) [optional]
colour yes;
// List of options per field
fieldInfo
{
// Colour map [optional]
colourMap <colourMap>;
p
{
// Colour map [optional]
colourMap <colourMap>;
// Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified
min 0;
max 1;
// Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
// Alpha channel [optional] (<scalar>)
alpha 0.5;
}
}
}
}
@ -73,35 +76,38 @@ Description
\verbatim
formatOptions
{
// Apply colours flag (yes | no) [optional]
colours yes;
// Animate tracks (yes | no) [optional]
animate yes;
// Animation properties [optional]
animationInfo
gltf
{
// Colour map [optional]
colourMap <colourMap>;
// Apply colours flag (yes | no) [optional]
colour yes;
// Colour [optional] (<vector> | uniform | field)
colour (1 0 0); // RGB in range [0-1]
// Animate tracks (yes | no) [optional]
animate yes;
//colour uniform;
//colourValue (1 0 0); // RGB in range [0-1]
// Animation properties [optional]
animationInfo
{
// Colour map [optional]
colourMap <colourMap>;
//colour field;
//colourField d;
// Colour [optional] (<vector> | uniform | field)
colour (1 0 0); // RGB in range [0-1]
// Colour map minimum and maximum limits [optional]
// Note: for colour = field option
// Uses field min and max if not specified
min 0;
max 1;
//colour uniform;
//colourValue (1 0 0); // RGB in range [0-1]
// Alpha channel [optional] (<scalar>)
alpha 0.5;
//colour field;
//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

View File

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