Solver of the adjoint to the eikonal PDE. More...
Public Member Functions | |
TypeName ("adjointEikonalSolver") | |
adjointEikonalSolver (const fvMesh &mesh, const dictionary &dict, const autoPtr< incompressible::RASModelVariables > &RASModelVars, incompressibleAdjointVars &adjointVars, const labelHashSet &sensitivityPatchIDs) | |
virtual | ~adjointEikonalSolver ()=default |
virtual bool | readDict (const dictionary &dict) |
void | accumulateIntegrand (const scalar dt) |
void | solve () |
void | reset () |
boundaryVectorField & | distanceSensitivities () |
tmp< volTensorField > | getFISensitivityTerm () const |
const volScalarField & | da () |
const volScalarField & | d () |
tmp< volVectorField > | gradEikonal () |
Protected Member Functions | |
wordList | patchTypes () const |
tmp< surfaceScalarField > | computeYPhi () |
void | read () |
Protected Attributes | |
const fvMesh & | mesh_ |
dictionary | dict_ |
const autoPtr< incompressible::RASModelVariables > & | RASModelVars_ |
autoPtr< Foam::incompressibleAdjoint::adjointRASModel > & | adjointTurbulence_ |
const labelHashSet & | sensitivityPatchIDs_ |
label | nEikonalIters_ |
scalar | tolerance_ |
scalar | epsilon_ |
labelHashSet | wallPatchIDs_ |
volScalarField | da_ |
volScalarField | source_ |
autoPtr< boundaryVectorField > | distanceSensPtr_ |
Solver of the adjoint to the eikonal PDE.
For the development of the adjoint eikonal PDE and its boundary conditions Papoutsis-Kiachagias, E. M., & Giannakoglou, K. C. (2014). Continuous Adjoint Methods for Turbulent Flows, Applied to Shape and Topology Optimization: Industrial Applications. Archives of Computational Methods in Engineering, 23(2), 255-299. http://doi.org/10.1007/s11831-014-9141-9
To be as consistent as possible, it is recommended to use the advectionDiffusion wallDist method in fvSchemes, instead of the more widely used meshWave
Example of the adjointEikonalSolver specification in optimisationDict:
optimisation { sensitivities { includeDistance true; adjointEikonalSolver { // epsilon should be the same as the one used // in fvSchemes/wallDist/advectionDiffusionCoeffs epsilon 0.1; iters 1000; tolerance 1e-6; } } }
Example of the entries in fvSchemes:
divSchemes { . . // avoid bounded schemes since yPhi is not conservative div(-yPhi,da) Gauss linearUpwind grad(da); . . } laplacianSchemes { . . laplacian(yWall,da) Gauss linear corrected; . . }
Also, the solver specification and a relaxation factor for da are required in fvSolution
da { solver PBiCGStab; preconditioner DILU; tolerance 1e-9; relTol 0.1; } relaxationFactors { equations { . . da 0.5; . . } }
Definition at line 142 of file adjointEikonalSolverIncompressible.H.
adjointEikonalSolver | ( | const fvMesh & | mesh, |
const dictionary & | dict, | ||
const autoPtr< incompressible::RASModelVariables > & | RASModelVars, | ||
incompressibleAdjointVars & | adjointVars, | ||
const labelHashSet & | sensitivityPatchIDs | ||
) |
Definition at line 106 of file adjointEikonalSolverIncompressible.C.
References Foam::read().
|
virtualdefault |
|
protected |
Definition at line 41 of file adjointEikonalSolverIncompressible.C.
References fvMesh::boundary(), adjointEikonalSolver::mesh_, and adjointEikonalSolver::wallPatchIDs_.
|
protected |
Definition at line 66 of file adjointEikonalSolverIncompressible.C.
References fvMesh::boundary(), GeometricField::boundaryFieldRef(), adjointEikonalSolver::d(), Foam::dimless, Foam::fvc::grad(), Foam::fvc::interpolate(), adjointEikonalSolver::mesh_, tmp::New(), IOobject::NO_READ, IOobject::NO_WRITE, patches, adjointEikonalSolver::RASModelVars_, fvMesh::Sf(), fvMesh::time(), Time::timeName(), adjointEikonalSolver::wallPatchIDs_, and Foam::Zero.
Referenced by adjointEikonalSolver::solve().
|
protected |
Definition at line 58 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::dict_, Foam::constant::electromagnetic::e, adjointEikonalSolver::epsilon_, dictionary::getOrDefault(), adjointEikonalSolver::nEikonalIters_, and adjointEikonalSolver::tolerance_.
Referenced by adjointEikonalSolver::solve().
TypeName | ( | "adjointEikonalSolver" | ) |
|
virtual |
Definition at line 163 of file adjointEikonalSolverIncompressible.C.
References dict, and adjointEikonalSolver::dict_.
void accumulateIntegrand | ( | const scalar | dt | ) |
Definition at line 171 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::adjointTurbulence_, and adjointEikonalSolver::source_.
void solve | ( | ) |
Definition at line 178 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::computeYPhi(), adjointEikonalSolver::d(), adjointEikonalSolver::da_, Foam::expressions::patchExpr::debug, Foam::fvm::div(), Foam::endl(), adjointEikonalSolver::epsilon_, Foam::gMax(), Foam::Info, Foam::fvc::laplacian(), Foam::fvm::laplacian(), Foam::mag(), adjointEikonalSolver::mesh_, adjointEikonalSolver::nEikonalIters_, Time::printExecutionTime(), adjointEikonalSolver::RASModelVars_, adjointEikonalSolver::read(), fvMatrix::relax(), fvMatrix::solve(), adjointEikonalSolver::source_, Foam::fvm::SuSp(), fvMesh::time(), and adjointEikonalSolver::tolerance_.
void reset | ( | ) |
Definition at line 225 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::distanceSensPtr_, adjointEikonalSolver::source_, VectorSpace< Vector< scalar >, scalar, 3 >::zero, and Foam::Zero.
boundaryVectorField & distanceSensitivities | ( | ) |
Definition at line 232 of file adjointEikonalSolverIncompressible.C.
References fvMesh::boundary(), GeometricField::boundaryField(), adjointEikonalSolver::d(), adjointEikonalSolver::da_, adjointEikonalSolver::distanceSensPtr_, Foam::endl(), Foam::Info, adjointEikonalSolver::mesh_, adjointEikonalSolver::RASModelVars_, and adjointEikonalSolver::sensitivityPatchIDs_.
tmp< volTensorField > getFISensitivityTerm | ( | ) | const |
Definition at line 253 of file adjointEikonalSolverIncompressible.C.
References IOobject::AUTO_WRITE, adjointEikonalSolver::d(), adjointEikonalSolver::da_, Foam::dimLength, Foam::endl(), adjointEikonalSolver::epsilon_, Foam::fvc::grad(), Foam::Info, adjointEikonalSolver::mesh_, IOobject::NO_READ, adjointEikonalSolver::RASModelVars_, tmp::ref(), fvMesh::time(), Time::timeName(), adjointEikonalSolver::wallPatchIDs_, and Foam::Zero.
const volScalarField & da | ( | ) |
Definition at line 303 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::da_.
const volScalarField& d | ( | ) |
Referenced by adjointEikonalSolver::computeYPhi(), adjointEikonalSolver::distanceSensitivities(), adjointEikonalSolver::getFISensitivityTerm(), adjointEikonalSolver::gradEikonal(), and adjointEikonalSolver::solve().
tmp< volVectorField > gradEikonal | ( | ) |
Definition at line 309 of file adjointEikonalSolverIncompressible.C.
References adjointEikonalSolver::d(), Foam::fvc::grad(), tmp::New(), and adjointEikonalSolver::RASModelVars_.
|
protected |
Definition at line 159 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::computeYPhi(), adjointEikonalSolver::distanceSensitivities(), adjointEikonalSolver::getFISensitivityTerm(), adjointEikonalSolver::patchTypes(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 161 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::read(), and adjointEikonalSolver::readDict().
|
protected |
Definition at line 163 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::computeYPhi(), adjointEikonalSolver::distanceSensitivities(), adjointEikonalSolver::getFISensitivityTerm(), adjointEikonalSolver::gradEikonal(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 166 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::accumulateIntegrand().
|
protected |
Definition at line 168 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::distanceSensitivities().
|
protected |
Definition at line 170 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::read(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 172 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::read(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 174 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::getFISensitivityTerm(), adjointEikonalSolver::read(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 176 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::computeYPhi(), adjointEikonalSolver::getFISensitivityTerm(), and adjointEikonalSolver::patchTypes().
|
protected |
Definition at line 178 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::da(), adjointEikonalSolver::distanceSensitivities(), adjointEikonalSolver::getFISensitivityTerm(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 180 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::accumulateIntegrand(), adjointEikonalSolver::reset(), and adjointEikonalSolver::solve().
|
protected |
Definition at line 183 of file adjointEikonalSolverIncompressible.H.
Referenced by adjointEikonalSolver::distanceSensitivities(), and adjointEikonalSolver::reset().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.