Quantity Monitoring Controllers

These controllers double the complexity once one or more monitored quantities has converged on the current complexity level.

FUN3D Force Monitoring Controller

class pyrefine.controller.monitor_forces.ControllerMonitorForcesFUN3D(project_name, pbs=None, monitor_cd=True, monitor_cl=False, monitor_cmx=False, monitor_cmy=False, monitor_cmz=False, monitor_cx=False, monitor_cy=False, monitor_cz=False)

Bases: ControllerMonitorQuantity

A controller to double the complexity of the adaptation based on the convergence of one or more integrated loads from the FUN3D forces file.

Parameters
  • project_name (str) – The root name of the project (without any mesh numbers)

  • pbs (:class:PBS) – PBS queue helper

  • monitor_cd (bool) – Whether to monitor the drag coefficient

  • monitor_cl (bool) – Whether to monitor the lift coefficient

  • monitor_cmx (bool) – Whether to monitor the x-moment coefficient

  • monitor_cmy (bool) – Whether to monitor the y-moment coefficient

  • monitor_cmz (bool) – Whether to monitor the z-moment coefficient

  • monitor_cx (bool) – Whether to monitor the x force coefficient

  • monitor_cy (bool) – Whether to monitor the y force coefficient

  • monitor_cz (bool) – Whether to monitor the z force coefficient

get_monitored_quantities_for_step(istep)

function to extract list of quantities to be monitored from the simulation corresponding to adaptation cycle istep.

Parameters

istep (int) – Adaptation step number

Returns

quantities – Variables to be monitored

Return type

list of floats

FUN3D SFE Force Monitoring Controller

class pyrefine.controller.monitor_forces.ControllerMonitorForcesSFE(project_name, pbs=None, monitor_cd=True, monitor_cl=False)

Bases: ControllerMonitorQuantity

A controller to double the complexity of the adaptation based on the convergence of CD and/or CL for SFE. SFE computes its own forces based on FE integration over the surface, but doesn’t write a separate force file, so we pull the CD and CL from the simulation log file

Parameters
  • project_name (str) – The root name of the project (without any mesh numbers)

  • pbs (:class:PBS) – PBS queue helper

  • monitor_cd (bool) – Whether to monitor the drag coefficient

  • monitor_cl (bool) – Whether to monitor the lift coefficient

get_monitored_quantities_for_step(istep)

function to extract list of quantities to be monitored from the simulation corresponding to adaptation cycle istep.

Parameters

istep (int) – Adaptation step number

Returns

Variables to be monitored

Return type

quantities

Monitoring Base Class

The Monitor Quantity controller is the base class for controllers that schedule the complexity based on convergence of some quantities.

class pyrefine.controller.monitor_quantity.ControllerMonitorQuantity(project_name, pbs=None)

Bases: ControllerBase

A controller to double the complexity of the adaptation based on the convergence of some quantity(s) of interest like lift or drag.

To monitor a quantity, you should subclass and implement the get_monitored_quantities_for_step() method.

Parameters
  • project_name (str) – The root name of the project (without any mesh numbers)

  • pbs (PBS) – PBS queue helper

maximum_steps_per_complexity

The maximum number of steps to take per complexity level if the monitored quantities do not converge

Type

int

relative_tolerance

The relative tolerance used in monitoring the convergence of the quantities of interest

Type

float

complexity_multiplier

the multiplier applied to the complexity when the complexity needs to be updated. The default value is 2.0.

Type

float

compute_complexity(istep, current_complexity)

Compute the complexity for the upcoming step based in the convergence or one of more integrated quantities

Parameters
  • istep (int) – Adaptation step number

  • current_complexity (float) – The current complexity in the driver. If doing a restart, the current complexity will be None

Return type

complexity

get_monitored_quantities_for_step(istep)

function to extract list of quantities to be monitored from the simulation corresponding to adaptation cycle istep.

Parameters

istep (int) – Adaptation step number

Returns

Variables to be monitored

Return type

quantities