Refine Multiscale Metric

The multiscale metric looks reduce interpolation error in the solution. For unsteady problems, the fixed point version can account for the change in the solution over the time period of interest and form an averaged metric.

Multiscale

class pyrefine.refine.multiscale.RefineMultiscale(project_name, pbs=None)

Bases: RefineBase

Refine for steady analysis (single solution field) and the multiscale metric based on Mach number

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

  • pbs (PBS) – PBS queue helper

lp_norm

The lp norm value for the refine metric computation. Larger values will target the regions of highest error more but may underresolve lower gradient regions too much. The default value is 4.

Type

int or float

interpolant

The name or file of the scalar field used as the interpolant. mach (default), incomp (incompressible vel magnitude), htot, pressure, density, temperature, or file.

Type

str

interpolant_label

The label for the interpolant file option.

Type

str

run(istep, complexity)

Runs refine to calculate a multiscale metric, generate a new mesh, and interpolate the solution to the new mesh.

Fixed Point Multiscale

class pyrefine.refine.multiscale.RefineMultiscaleFixedPoint(project_name, pbs=None)

Bases: RefineMultiscale

Refine’s fixed point metric for unsteady analysis where there are multiple snapshots of the flow field. Multiscale metric based on Mach number.

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

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

window_first_step

The start of the sampling window from which refine should compute the metric.

Type

int

window_last_step

The end of the sampling window from which refine should compute the metric.

Type

int

window_metric_freq

The sampling frequency in the window from which refine should compute the metric.

Type

int

sampling_data_filename_body

The middle part of the filename which refine should look for the scalar on which to base the metric on. For example, bscw-box20[_sampling_geom1_timestep]1000.solb #: where the body is the part in square brackets before the timestep number (1000) and after the project name + adaptation cycle number (bscw-box20). The default name is “_sampling_geom1_timestep”

Type

str

set_timestep_range_and_frequency(first_step, last_step, metric_freq)

Set the window of timesteps from which refine should compute the metric and set the metric step frequency, i.e. the frequency at which solution files were saved during the analysis in window.

Parameters
  • first_step (int) –

  • last_step (int) –

  • metric_freq (int) –

set_hlres(mach, reynolds_number)

Set the window of timesteps from which refine should compute the metric and set the metric step frequency, i.e. the frequency at which solution files were saved during the analysis in window.

Parameters
  • mach (float) – The reference Mach number

  • reynolds_number (float) – The reference Reynolds number per unit length

run(istep, complexity)

Run refine in fixed-point mode for unsteady problems