mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
INT: Minor integration updates
This commit is contained in:
committed by
Andrew Heather
parent
3ef0d19ef4
commit
90d62c33e4
@ -31,10 +31,11 @@ License
|
|||||||
#include "PrimitivePatchInterpolation.H"
|
#include "PrimitivePatchInterpolation.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "faCFD.H"
|
#include "faMatrices.H"
|
||||||
#include "fixedValueFaPatchFieldsFwd.H"
|
#include "famSup.H"
|
||||||
|
#include "famLaplacian.H"
|
||||||
|
#include "volSurfaceMapping.H"
|
||||||
#include "fixedValueFaPatchFields.H"
|
#include "fixedValueFaPatchFields.H"
|
||||||
#include "zeroGradientFaPatchFieldsFwd.H"
|
|
||||||
#include "zeroGradientFaPatchFields.H"
|
#include "zeroGradientFaPatchFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -79,7 +80,7 @@ void sensitivitySurface::addGeometricSens()
|
|||||||
for (const label patchI : sensitivityPatchIDs_)
|
for (const label patchI : sensitivityPatchIDs_)
|
||||||
{
|
{
|
||||||
const fvPatch& patch = mesh_.boundary()[patchI];
|
const fvPatch& patch = mesh_.boundary()[patchI];
|
||||||
vectorField nf(patch.nf());
|
const vectorField nf(patch.nf());
|
||||||
|
|
||||||
// point sens result for patch
|
// point sens result for patch
|
||||||
vectorField& patchdSdb = pointSensdSdb()[patchI];
|
vectorField& patchdSdb = pointSensdSdb()[patchI];
|
||||||
@ -87,14 +88,10 @@ void sensitivitySurface::addGeometricSens()
|
|||||||
|
|
||||||
vectorField dSdbMultiplierTot(patch.size(), Zero);
|
vectorField dSdbMultiplierTot(patch.size(), Zero);
|
||||||
vectorField dndbMultiplierTot(patch.size(), Zero);
|
vectorField dndbMultiplierTot(patch.size(), Zero);
|
||||||
forAll(functions, funcI)
|
for (auto& fun : functions)
|
||||||
{
|
{
|
||||||
dSdbMultiplierTot +=
|
dSdbMultiplierTot += fun.weight()*fun.dSdbMultiplier(patchI);
|
||||||
functions[funcI].weight()
|
dndbMultiplierTot += fun.weight()*fun.dndbMultiplier(patchI);
|
||||||
*functions[funcI].dSdbMultiplier(patchI);
|
|
||||||
dndbMultiplierTot +=
|
|
||||||
functions[funcI].weight()
|
|
||||||
*functions[funcI].dndbMultiplier(patchI);
|
|
||||||
}
|
}
|
||||||
// Correspondence of local point addressing to global point
|
// Correspondence of local point addressing to global point
|
||||||
// addressing
|
// addressing
|
||||||
@ -114,13 +111,12 @@ void sensitivitySurface::addGeometricSens()
|
|||||||
forAll(meshPoints, ppI)
|
forAll(meshPoints, ppI)
|
||||||
{
|
{
|
||||||
const labelList& pointFaces = patchPointFaces[ppI];
|
const labelList& pointFaces = patchPointFaces[ppI];
|
||||||
forAll(pointFaces, pfI)
|
for (label localFaceIndex : pointFaces)
|
||||||
{
|
{
|
||||||
label localFaceIndex = pointFaces[pfI];
|
|
||||||
label globalFaceIndex = patchStartIndex + localFaceIndex;
|
label globalFaceIndex = patchStartIndex + localFaceIndex;
|
||||||
const face& faceI = faces[globalFaceIndex];
|
const face& faceI = faces[globalFaceIndex];
|
||||||
// Point coordinates. All indices in global numbering
|
// Point coordinates. All indices in global numbering
|
||||||
pointField p(faceI.points(mesh_.points()));
|
const pointField p(faceI.points(mesh_.points()));
|
||||||
tensorField p_d(faceI.size(), Zero);
|
tensorField p_d(faceI.size(), Zero);
|
||||||
forAll(faceI, facePointI)
|
forAll(faceI, facePointI)
|
||||||
{
|
{
|
||||||
@ -129,8 +125,10 @@ void sensitivitySurface::addGeometricSens()
|
|||||||
p_d[facePointI] = tensor::I;
|
p_d[facePointI] = tensor::I;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tensorField deltaNormals =
|
const tensorField deltaNormals
|
||||||
dBoundary.makeFaceCentresAndAreas_d(p, p_d);
|
(
|
||||||
|
dBoundary.makeFaceCentresAndAreas_d(p, p_d)
|
||||||
|
);
|
||||||
|
|
||||||
// Element [1] is the variation in the (dimensional) normal
|
// Element [1] is the variation in the (dimensional) normal
|
||||||
const tensor& deltaSf = deltaNormals[1];
|
const tensor& deltaSf = deltaNormals[1];
|
||||||
@ -280,7 +278,7 @@ void sensitivitySurface::smoothSensitivities()
|
|||||||
polyMeshPatches[i++] = mesh_.boundary()[patchID].name();
|
polyMeshPatches[i++] = mesh_.boundary()[patchID].name();
|
||||||
}
|
}
|
||||||
faMeshDefinition.add<wordList>("polyMeshPatches", polyMeshPatches);
|
faMeshDefinition.add<wordList>("polyMeshPatches", polyMeshPatches);
|
||||||
dictionary& boundary = faMeshDefinition.subDictOrAdd("boundary");
|
(void)faMeshDefinition.subDictOrAdd("boundary");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct faMesh
|
// Construct faMesh
|
||||||
|
|||||||
Reference in New Issue
Block a user