Skip to content
Snippets Groups Projects
Commit 530a5192 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'fix-adjointRotatingWall-sens' into 'master'

BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180

Closes #3180

See merge request !690
parents 51a34f5a 2ef96e9e
No related branches found
No related tags found
1 merge request!690BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180
...@@ -420,19 +420,21 @@ void Foam::incompressibleAdjointSolver::accumulateBCSensitivityIntegrand ...@@ -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)
{
tmp<vectorField> DvDbMult = const fvPatch& patch = mesh_.boundary()[patchI];
nuEffBoundary[patchI]*(Uab.snGrad() + (gradUabf[patchI] & tnf)) tmp<vectorField> tnf = patch.nf();
// - (nf*pa.boundaryField()[patchI]) const scalarField& magSf = patch.magSf();
+ adjointTurbulence().adjointMomentumBCSource()[patchI];
bcDxDbMult()[patchI] += tmp<vectorField> DvDbMult =
( nuEffBoundary[patchI]
DvDbMult *(Uab.snGrad() + (gradUabf[patchI] & tnf))
& refCast<adjointVectorBoundaryCondition>(Uab).dxdbMult() // - (nf*pa.boundaryField()[patchI])
)*magSf*dt; + adjointTurbulence().adjointMomentumBCSource()[patchI];
bcDxDbMult()[patchI] += (DvDbMult & dxdbMult())*magSf*dt;
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment