Skip to content

Commit 8c7d091

Browse files
Improved field inversion codes. (#345)
* Added DAkOmegaSSTfieldInversion model * Added kOmegaSSTfieldInversion files in src/adjoint/model and added related code in make files * Added new model kOmegaSSTfieldInversion In the modified model a beta field (called betaFieldInversion) is multiplied to the production term of the omega transport equation. * Renamed kOmegaSSTfieldInversion model to match OF convention * Update DAkOmegaSSTFieldInversion.C * fixed DAkOmegaSSTFieldInversion make error * Revert "Update DAkOmegaSSTFieldInversion.C" This reverts commit 314959f. * betaFieldInversion modifies both k and omega equations * Renamed SAFv3Beta model and fields for field inversion * Unfinished codes for improving kOmegaSSTFieldInversion * Update kOmegaSSTFieldInversion * Replaced the name betaPrior with betaRefFieldInversion * Fixed field naming issue in kOmegSSTFieldInversion * Initial codes for surfaceFriction-based objective function * Resolved some of the compilation errors from previous commit * fixed typo in devReff * Fixed some errors * Fixed final compilation error. * Fixed objective function based on surfaceFriction * New formulation for surface friction calculation * Preliminary codes for aeroCoeff type objFuncs * Improvements to aeroCoeff loop * Fixed aeroCoeff-based objective function, but debug still required! * Fixed bugs in field inversion objective functions * New FI objFunc based on velocity profile data * Preliminary codes for pressure-based data; buggy when running in parallel * fixed bugs in SAFv3FI model * latest from debug_solver * Replaced everything with most recent updates from debug_solver * Removed all old files. * All the latest files. * Latest * Tests for FI turbulence models * Update Allrun * Scale CFD field before L2 norm * Added shifted Cp objective function for PH case * Added Allmake8 to compile with 8 processors * Update Allmake8 * Added custom surface friction loop * fixed surfaceFrictionCustom loop * Added profileRefFieldInversion for kOmegaFI models * Added profileRefFieldInversion for kOmegaFI models * Fixed errors * Fixed more errors * Added all the FI fields for the kOmegaFI models * Added codes to use wallShearStress data for field inversion * initial scripts to test field inversion based on weighted objective function data term * fixed Make files * fixed compressible Make file * more fixes to Make files * Preliminary codes to use weights for surface data when calculating objective functions. * fixed issues in last commit * Change initial weightsObjFunc files * Update DAObjFuncFieldInversion.C * fixed weighted Cf/WSS/Cp loop * more fixes * Added adaptive weight computation for Cp-based objective function * Fixed errors in last commit * More fixes * More fixes * Adaptive weights for velocity profiles (preliminary) * Fixed error * Fixed error * fixed error * Adaptive weighted surface friction * fixes * Update DAObjFuncFieldInversion.C * fixed errors from previous commit; added adaptiveWeightsSurfaceFriction * - * Fixed custom Cp loop to read pRef * Added standard Spalart-Allmaras filed inversion * Update DAkOmegaSSTFieldInversion.C Removed perturbation of the omega transport equation. * Update DASpalartAllmarasFieldInversion.C * Update DAkOmegaSSTFieldInversion.C * added k-epsilon field inversion with modification to the epsilon equation * fixes * fixed typo * fixed error * Added field inversion variables for the kOmegaSSTFieldInversion model. * Added codes to use Reynolds stress components for kOmegaFieldInversionOmega model. * fixed errors. * fixed errors. * Update DAkOmegaFieldInversionOmega.H * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Update DAObjFuncFieldInversion.C * Fixed a problem in the test. * Cleaned up features in development. * Fixed error. * Removed .vscode * Added regression test for kOmegaSSTFieldInversion * Added Allmake8 * Added regression tests for field inversion objective functions. * Added regression tests for field inversion objective functions. * Update Allmake8 * FI objective function with pressure profiles * Fixed error * Update DAObjFuncFieldInversion.C * Improved codes for field inversion with Cp data * fixed bracket error * fixed bracket error * Update DAObjFuncFieldInversion.C * fixed FI Cp loop for parallel runs * fixed FI Cp loop for parallel runs * Added capability to use discrete velocity data for field inversion where any component can be used * Added capability to use discrete velocity data for field inversion where any component can be used * Update DAObjFuncFieldInversion.C * Improved field inversion codes. Still need to fix test scripts. * Update DAObjFuncFieldInversion.C * Fixed test scripts. * Update DAFoam_Test_DASimpleFoamFieldRef.txt * Update DAObjFuncFieldInversion.C * Brought back betaFieldInversion requirement initially * Update SpalartAllmarasFv3FieldInversion.H * Updates kOmegaFieldInversionOmega and kOmegaSSTFieldInversion models, and fixed DASimpleFoamField test ref. * Added tests, and renamed field inversion objective function for skin friction in periodic hill flow * Removed Allmake8 * Added comments in DAObjFuncFieldInversion.C * Updated DASimpleFoamFieldInversionObjectiveFunctionRef.txt Co-authored-by: Ping He <[email protected]>
1 parent e4ba2cf commit 8c7d091

21 files changed

+491
-536
lines changed

src/adjoint/DAModel/DATurbulenceModel/DASpalartAllmarasFv3FieldInversion.C

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,16 @@ DASpalartAllmarasFv3FieldInversion::DASpalartAllmarasFv3FieldInversion(
106106
nuTildaRes_),
107107
betaFieldInversion_(const_cast<volScalarField&>(
108108
mesh.thisDb().lookupObject<volScalarField>("betaFieldInversion"))),
109-
betaRefFieldInversion_(const_cast<volScalarField&>(
110-
mesh.thisDb().lookupObject<volScalarField>("betaRefFieldInversion"))),
111-
varRefFieldInversion_(const_cast<volVectorField&>(
112-
mesh.thisDb().lookupObject<volVectorField>("varRefFieldInversion"))),
109+
UData_(const_cast<volVectorField&>(
110+
mesh.thisDb().lookupObject<volVectorField>("UData"))),
113111
surfaceFriction_(const_cast<volScalarField&>(
114112
mesh.thisDb().lookupObject<volScalarField>("surfaceFriction"))),
115-
surfaceFrictionRef_(const_cast<volScalarField&>(
116-
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionRef"))),
117-
surfacePressureRef_(const_cast<volScalarField&>(
118-
mesh.thisDb().lookupObject<volScalarField>("surfacePressureRef"))),
119-
profileRefFieldInversion_(const_cast<volScalarField&>(
120-
mesh.thisDb().lookupObject<volScalarField>("profileRefFieldInversion"))),
121-
//TauDNS_(const_cast<volSymmTensorField&>(
122-
// mesh.thisDb().lookupObject<volSymmTensorField>("TauDNS"))),
113+
surfaceFrictionData_(const_cast<volScalarField&>(
114+
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionData"))),
115+
pData_(const_cast<volScalarField&>(
116+
mesh.thisDb().lookupObject<volScalarField>("pData"))),
117+
USingleComponentData_(const_cast<volScalarField&>(
118+
mesh.thisDb().lookupObject<volScalarField>("USingleComponentData"))),
123119
y_(mesh.thisDb().lookupObject<volScalarField>("yWall"))
124120
{
125121

src/adjoint/DAModel/DATurbulenceModel/DASpalartAllmarasFv3FieldInversion.H

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,20 @@ protected:
9393
/// A beta field multiplying to the production term
9494
volScalarField& betaFieldInversion_;
9595

96-
/// a reference beta field
97-
volScalarField betaRefFieldInversion_;
98-
99-
/// reference field (e.g. velocity for DNS)
100-
volVectorField& varRefFieldInversion_;
101-
102-
/// reference Reynolds stress field
103-
//volSymmTensorField TauDNS_;
96+
/// reference velocity field
97+
volVectorField UData_;
10498

10599
/// a surface friction 'field' when using skin friction data for field inversion
106100
volScalarField surfaceFriction_;
107101

108102
/// the reference field for surfaceFriction
109-
volScalarField surfaceFrictionRef_;
103+
volScalarField surfaceFrictionData_;
110104

111-
/// the reference field for surfacePressure
112-
volScalarField surfacePressureRef_;
105+
/// the reference field for pressure
106+
volScalarField pData_;
113107

114108
/// reference field for profile data
115-
volScalarField profileRefFieldInversion_;
109+
volScalarField USingleComponentData_;
116110

117111
/// 3D wall distance
118112
const volScalarField& y_;

src/adjoint/DAModel/DATurbulenceModel/DAkOmegaFieldInversionOmega.C

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,19 @@ DAkOmegaFieldInversionOmega::DAkOmegaFieldInversionOmega(
101101
#endif
102102
zeroGradientFvPatchField<scalar>::typeName),
103103
/// field inversion parameters
104+
/// field inversion parameters
104105
betaFieldInversion_(const_cast<volScalarField&>(
105106
mesh.thisDb().lookupObject<volScalarField>("betaFieldInversion"))),
106-
betaRefFieldInversion_(const_cast<volScalarField&>(
107-
mesh.thisDb().lookupObject<volScalarField>("betaRefFieldInversion"))),
108-
profileRefFieldInversion_(const_cast<volScalarField&>(
109-
mesh.thisDb().lookupObject<volScalarField>("profileRefFieldInversion"))),
110107
surfaceFriction_(const_cast<volScalarField&>(
111108
mesh.thisDb().lookupObject<volScalarField>("surfaceFriction"))),
112-
surfaceFrictionRef_(const_cast<volScalarField&>(
113-
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionRef"))),
114-
surfacePressureRef_(const_cast<volScalarField&>(
115-
mesh.thisDb().lookupObject<volScalarField>("surfacePressureRef"))),
116-
varRefFieldInversion_(const_cast<volVectorField&>(
117-
mesh.thisDb().lookupObject<volVectorField>("varRefFieldInversion"))),
118-
tauDNS_(const_cast<volSymmTensorField&>(
119-
mesh.thisDb().lookupObject<volSymmTensorField>("tauDNS"))),
120-
tauRANS_(const_cast<volSymmTensorField&>(
121-
mesh.thisDb().lookupObject<volSymmTensorField>("tauRANS")))
109+
surfaceFrictionData_(const_cast<volScalarField&>(
110+
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionData"))),
111+
pData_(const_cast<volScalarField&>(
112+
mesh.thisDb().lookupObject<volScalarField>("pData"))),
113+
UData_(const_cast<volVectorField&>(
114+
mesh.thisDb().lookupObject<volVectorField>("UData"))),
115+
USingleComponentData_(const_cast<volScalarField&>(
116+
mesh.thisDb().lookupObject<volScalarField>("USingleComponentData")))
122117
{
123118

124119
// initialize printInterval_ we need to check whether it is a steady state

src/adjoint/DAModel/DATurbulenceModel/DAkOmegaFieldInversionOmega.H

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,20 @@ protected:
111111
/// A beta field multiplying to the production term
112112
volScalarField& betaFieldInversion_;
113113

114-
/// a reference beta field
115-
volScalarField betaRefFieldInversion_;
116-
117-
/// reference field for profile data
118-
volScalarField profileRefFieldInversion_;
119-
120114
/// a surface friction 'field' when using skin friction data for field inversion
121115
volScalarField surfaceFriction_;
122116

123117
/// the reference field for surfaceFriction
124-
volScalarField surfaceFrictionRef_;
118+
volScalarField surfaceFrictionData_;
125119

126120
/// the reference field for surfacePressure
127-
volScalarField surfacePressureRef_;
121+
volScalarField pData_;
128122

129123
/// reference field (e.g. velocity for DNS)
130-
volVectorField& varRefFieldInversion_;
131-
132-
/// reference Reynolds stress field
133-
volSymmTensorField tauDNS_;
124+
volVectorField UData_;
134125

135-
/// RANS Reynolds stress field
136-
volSymmTensorField tauRANS_;
126+
/// the reference pressure field data
127+
volScalarField USingleComponentData_;
137128

138129
public:
139130
TypeName("kOmegaFieldInversionOmega");

src/adjoint/DAModel/DATurbulenceModel/DAkOmegaSSTFieldInversion.C

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,16 @@ DAkOmegaSSTFieldInversion::DAkOmegaSSTFieldInversion(
183183
/// field inversion parameters
184184
betaFieldInversion_(const_cast<volScalarField&>(
185185
mesh.thisDb().lookupObject<volScalarField>("betaFieldInversion"))),
186-
betaRefFieldInversion_(const_cast<volScalarField&>(
187-
mesh.thisDb().lookupObject<volScalarField>("betaRefFieldInversion"))),
188-
profileRefFieldInversion_(const_cast<volScalarField&>(
189-
mesh.thisDb().lookupObject<volScalarField>("profileRefFieldInversion"))),
190186
surfaceFriction_(const_cast<volScalarField&>(
191187
mesh.thisDb().lookupObject<volScalarField>("surfaceFriction"))),
192-
surfaceFrictionRef_(const_cast<volScalarField&>(
193-
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionRef"))),
194-
surfacePressureRef_(const_cast<volScalarField&>(
195-
mesh.thisDb().lookupObject<volScalarField>("surfacePressureRef"))),
196-
varRefFieldInversion_(const_cast<volVectorField&>(
197-
mesh.thisDb().lookupObject<volVectorField>("varRefFieldInversion"))),
188+
surfaceFrictionData_(const_cast<volScalarField&>(
189+
mesh.thisDb().lookupObject<volScalarField>("surfaceFrictionData"))),
190+
pData_(const_cast<volScalarField&>(
191+
mesh.thisDb().lookupObject<volScalarField>("pData"))),
192+
UData_(const_cast<volVectorField&>(
193+
mesh.thisDb().lookupObject<volVectorField>("UData"))),
194+
USingleComponentData_(const_cast<volScalarField&>(
195+
mesh.thisDb().lookupObject<volScalarField>("USingleComponentData"))),
198196
y_(mesh_.thisDb().lookupObject<volScalarField>("yWall"))
199197
{
200198

src/adjoint/DAModel/DATurbulenceModel/DAkOmegaSSTFieldInversion.H

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,20 @@ protected:
178178
/// A beta field multiplying to the production term
179179
volScalarField& betaFieldInversion_;
180180

181-
/// a reference beta field
182-
volScalarField betaRefFieldInversion_;
183-
184-
/// reference field for profile data
185-
volScalarField profileRefFieldInversion_;
186-
187181
/// a surface friction 'field' when using skin friction data for field inversion
188182
volScalarField surfaceFriction_;
189183

190184
/// the reference field for surfaceFriction
191-
volScalarField surfaceFrictionRef_;
185+
volScalarField surfaceFrictionData_;
192186

193187
/// the reference field for surfacePressure
194-
volScalarField surfacePressureRef_;
188+
volScalarField pData_;
195189

196190
/// reference field (e.g. velocity for DNS)
197-
volVectorField& varRefFieldInversion_;
191+
volVectorField UData_;
192+
193+
/// the reference pressure field data
194+
volScalarField USingleComponentData_;
198195

199196
/// Name of turbulent transport equation to modify: can be k, omega, or all
200197
/// if k OR omega is selected the field inversion modification is: ProdTerm(k or omega)*betaFieldInversion

0 commit comments

Comments
 (0)