Goal-oriented Metrics

Goal-oriented metrics are based on adjoint solutions which is a more target adaptation metric focusing on a single cost function like lift or drag. The goal-oriented metric objects need to be paired with simulation objects that compute an adjoint solution (see FUN3D Adjoint Simulations).

class pyrefine.refine.goal_oriented.RefineGoalOriented(project_name, pbs=None, mask_strong_bc=False)

Bases: RefineBase

Refine goal-oriented adaptation metric. Options for the ‘opt-goal’ or cons-visc’ versions of the metric

mask_strong_bc

Mask strong boundaries in the adjoint field to create a smooth adjoint field

Type

bool

mach

Reference Mach number. Only needed for metric_from=`’cons-visc’`

Type

float

reynolds_number

Reference Reynolds number. Only needed for metric_from=`’cons-visc’`

Type

float

temperature

Reference Temperature in Kelvin. Only needed for metric_from=`’cons-visc’`

Type

float

property metric_form: str
The type of goal oriented metric to use in refine.
Options are:
1. ‘opt-goal’ - the Euler metric
2. ‘cons_visc’ - the viscous metric. Requires also setting the properties: mach, reynolds_number, and temperature
Type

str

Return type

str

set_metric_form_opt_goal()

Set the type of goal oriented metric to ‘opt-goal’

set_metric_form_cons_visc(mach, reynolds_number, temperature)

Set the type of goal oriented metric to cons-visc and set related properties.

Parameters
  • mach (float) – The reference Mach number

  • reynolds_number (float) – The reference Reynolds number

  • temperature (float) – The reference temperature in Kelvin

run(istep, complexity)

Given a primal and dual field in the form of prim_dual.solb and complexity, call refine to compute a goal-oriented metric and adapt.