From 1c40d738534fdc0cc2d1a3ddbad8a17d11558d07 Mon Sep 17 00:00:00 2001 From: Ping He Date: Sat, 17 Feb 2024 10:48:49 -0600 Subject: [PATCH] Allowed using existing objFunc for refDiffSquare (#590) * Added an option to use time-dependent ref for refDiffSquare. * Added tests and fixed an issue for refDiffSquare. --- src/adjoint/DAObjFunc/DAObjFunc.C | 25 +++++++++++++++++- src/adjoint/DAObjFunc/DAObjFunc.H | 8 +++--- .../DAObjFunc/DAObjFuncCenterOfPressure.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncForce.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncLocation.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncMass.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncMassFlowRate.C | 6 ++--- .../DAObjFunc/DAObjFuncMeshQualityKS.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncMoment.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncPatchMean.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncPower.C | 6 ++--- .../DAObjFunc/DAObjFuncTotalPressure.C | 6 ++--- .../DAObjFunc/DAObjFuncTotalPressureRatio.C | 6 ++--- .../DAObjFuncTotalTemperatureRatio.C | 6 ++--- .../DAObjFunc/DAObjFuncVariableVolSum.C | 6 ++--- .../DAObjFunc/DAObjFuncVonMisesStressKS.C | 6 ++--- src/adjoint/DAObjFunc/DAObjFuncWallHeatFlux.C | 6 ++--- tests/refs/DAFoam_Test_DAPimpleFoamRef.txt | 26 +++++++++++++++++++ tests/runTests_DAPimpleFoam.py | 16 ++++++++++++ tests/runTests_DASimpleFoamAD.py | 2 +- 20 files changed, 102 insertions(+), 65 deletions(-) diff --git a/src/adjoint/DAObjFunc/DAObjFunc.C b/src/adjoint/DAObjFunc/DAObjFunc.C index 89a8c5bc..22c7c999 100755 --- a/src/adjoint/DAObjFunc/DAObjFunc.C +++ b/src/adjoint/DAObjFunc/DAObjFunc.C @@ -59,7 +59,7 @@ DAObjFunc::DAObjFunc( calcRefDiffSquare_ = objFuncDict_.lookupOrDefault