Classes | Functions | Variables
dafoam.optFuncs Namespace Reference

Classes

class  Info
 

Functions

def calcObjFuncValues (xDV)
 
def calcObjFuncValuesMP (xDV)
 
def calcObjFuncValuesUnsteady (xDV)
 
def calcObjFuncSens (xDV, funcs)
 
def calcObjFuncSensMP (xDV, funcs)
 
def calcObjFuncSensUnsteady (xDV, funcs)
 
def runPrimal (objFun=calcObjFuncValues)
 
def runAdjoint (objFun=calcObjFuncValues, sensFun=calcObjFuncSens, fileName=None)
 
def runForwardAD (dvName="None", seedIndex=-1)
 
def solveCL (CL_star, alphaName, liftName, objFun=calcObjFuncValues, eps=1e-2, tol=1e-4, maxit=10)
 
def calcFDSens (objFun=calcObjFuncValues, fileName=None)
 
def runLowOrderPrimal4PC ()
 

Variables

 precision
 
 suppress
 

Detailed Description

    DAFoam  : Discrete Adjoint with OpenFOAM
    Version : v3

    Description:
    Common functions for DAFoam optimization setup.

Function Documentation

◆ calcObjFuncValues()

def dafoam.optFuncs.calcObjFuncValues (   xDV)
Update the design surface and run the primal solver to get objective function values.

Definition at line 27 of file optFuncs.py.

◆ calcObjFuncValuesMP()

def dafoam.optFuncs.calcObjFuncValuesMP (   xDV)
Update the design surface and run the primal solver to get objective function values.
This is the multipoint version of calcObjFuncValues

Definition at line 69 of file optFuncs.py.

◆ calcObjFuncValuesUnsteady()

def dafoam.optFuncs.calcObjFuncValuesUnsteady (   xDV)
Update the design surface and run the primal solver to get objective function values.
This is the unsteady adjoint version of calcObjFuncValues

Definition at line 140 of file optFuncs.py.

◆ calcObjFuncSens()

def dafoam.optFuncs.calcObjFuncSens (   xDV,
  funcs 
)
Run the adjoint solver and get objective function sensitivities.

Definition at line 187 of file optFuncs.py.

◆ calcObjFuncSensMP()

def dafoam.optFuncs.calcObjFuncSensMP (   xDV,
  funcs 
)
Run the adjoint solver and get objective function sensitivities.
This is the multipoint version of calcObjFuncSens

Definition at line 233 of file optFuncs.py.

◆ calcObjFuncSensUnsteady()

def dafoam.optFuncs.calcObjFuncSensUnsteady (   xDV,
  funcs 
)
Run the adjoint solver and get objective function sensitivities.
This is the unsteady adjoint version of calcObjFuncSens

Definition at line 306 of file optFuncs.py.

◆ runPrimal()

def dafoam.optFuncs.runPrimal (   objFun = calcObjFuncValues)
Just run the primal

Definition at line 395 of file optFuncs.py.

◆ runAdjoint()

def dafoam.optFuncs.runAdjoint (   objFun = calcObjFuncValues,
  sensFun = calcObjFuncSens,
  fileName = None 
)
Just run the primal and adjoint

Definition at line 407 of file optFuncs.py.

◆ runForwardAD()

def dafoam.optFuncs.runForwardAD (   dvName = "None",
  seedIndex = -1 
)
Run the forward mode AD for the primal solver to compute the brute force total
derivative. This is primarily used in verification of the adjoint accuracy

Definition at line 439 of file optFuncs.py.

◆ solveCL()

def dafoam.optFuncs.solveCL (   CL_star,
  alphaName,
  liftName,
  objFun = calcObjFuncValues,
  eps = 1e-2,
  tol = 1e-4,
  maxit = 10 
)
Adjust the angle of attack or pitch to match the target lift.
This is usually needed for wing aerodynamic optimization

Definition at line 454 of file optFuncs.py.

◆ calcFDSens()

def dafoam.optFuncs.calcFDSens (   objFun = calcObjFuncValues,
  fileName = None 
)
Compute finite-difference sensitivity

Definition at line 491 of file optFuncs.py.

◆ runLowOrderPrimal4PC()

def dafoam.optFuncs.runLowOrderPrimal4PC ( )

Definition at line 544 of file optFuncs.py.

Variable Documentation

◆ precision

precision

Definition at line 24 of file optFuncs.py.

◆ suppress

suppress

Definition at line 24 of file optFuncs.py.