adjointShapeOptimizationFoam: Added support for fvOptions
This commit is contained in:
parent
d7c56992e3
commit
90afa6ddb5
@ -5,11 +5,13 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
-lmeshTools \
|
||||
-lfvOptions
|
||||
|
@ -49,6 +49,7 @@ Description
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "simpleControl.H"
|
||||
#include "fvIOoptionList.H"
|
||||
|
||||
template<class Type>
|
||||
void zeroCells
|
||||
@ -76,9 +77,12 @@ int main(int argc, char *argv[])
|
||||
simpleControl simple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "initAdjointContinuityErrs.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -108,12 +112,18 @@ int main(int argc, char *argv[])
|
||||
fvm::div(phi, U)
|
||||
+ turbulence->divDevReff(U)
|
||||
+ fvm::Sp(alpha, U)
|
||||
==
|
||||
fvOptions(U)
|
||||
);
|
||||
|
||||
UEqn().relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
@ -150,6 +160,7 @@ int main(int argc, char *argv[])
|
||||
// Momentum corrector
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
// Adjoint Pressure-velocity SIMPLE corrector
|
||||
@ -173,12 +184,18 @@ int main(int argc, char *argv[])
|
||||
- adjointTransposeConvection
|
||||
+ turbulence->divDevReff(Ua)
|
||||
+ fvm::Sp(alpha, Ua)
|
||||
==
|
||||
fvOptions(Ua)
|
||||
);
|
||||
|
||||
UaEqn().relax();
|
||||
|
||||
fvOptions.constrain(UaEqn());
|
||||
|
||||
solve(UaEqn() == -fvc::grad(pa));
|
||||
|
||||
fvOptions.correct(Ua);
|
||||
|
||||
volScalarField rAUa(1.0/UaEqn().A());
|
||||
volVectorField HbyAa("HbyAa", Ua);
|
||||
HbyAa = rAUa*UaEqn().H();
|
||||
@ -215,6 +232,7 @@ int main(int argc, char *argv[])
|
||||
// Adjoint momentum corrector
|
||||
Ua = HbyAa - rAUa*fvc::grad(pa);
|
||||
Ua.correctBoundaryConditions();
|
||||
fvOptions.correct(Ua);
|
||||
}
|
||||
|
||||
laminarTransport.correct();
|
||||
|
Loading…
Reference in New Issue
Block a user