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];
|
||||
if (isA<adjointVectorBoundaryCondition>(Uab))
|
||||
{
|
||||
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))
|
||||
nuEffBoundary[patchI]
|
||||
*(Uab.snGrad() + (gradUabf[patchI] & tnf))
|
||||
// - (nf*pa.boundaryField()[patchI])
|
||||
+ adjointTurbulence().adjointMomentumBCSource()[patchI];
|
||||
bcDxDbMult()[patchI] +=
|
||||
(
|
||||
DvDbMult
|
||||
& refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult()
|
||||
)*magSf*dt;
|
||||
bcDxDbMult()[patchI] += (DvDbMult & dxdbMult())*magSf*dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user