mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'fix-adjointRotatingWall-sens' into 'master'
BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180 Closes #3180 See merge request Development/openfoam!690
This commit is contained in:
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user