Managers: running an analysis

The srlife.managers.SolutionManager class manages an analysis, taking the basic input information:

  1. The fully-populated srlife.receiver.Receiver class.

  2. The thermal, fluid, deformation, and damage material models.

  3. The thermal, structural, and system solvers.

  4. Optionally, a srlife.solverparams.ParameterSet class defining solution parameters, including the number of parallel threads to use in the analysis

and providing the estimated life of the receiver as a number of repetitions of the daily cycle.

Once the manager class is constructed for metallic materials the user only needs to call the

life = manager.solve_life()

method, which completes the full analysis and returns the estimated life in terms of the number of expected single-day repetitions. The calculation scales the results appropriately given the number of explicitly-defined days provided to the srlife.receiver.Receiver.

For ceramic materials function instead returns the time independent reliability of the design

reliability = manager.solve_life()

SolutionManager description

The srlife.managers.SolutionManager is a wrapper around several internal srlife subclasses. Specifically, the manager handles the process of:

  1. Solving for the tube temperatures given the thermal boundary conditions.

  2. Solving for the stress/strain deformation response of each tube. Depending on the interconnect stiffnesses provided by the user these tube problems may be coupled in a 1D sense through the tube top-surface displacements.

  3. Using the temperature and stress/strain information to solve for the damage in each tube.

  4. Finding the worst-case tube and calculating the estimated life or estimated reliability.

class srlife.managers.SolutionManager(receiver, thermal_solver, thermal_material, fluid_material, structural_solver, deformation_material, damage_material, system_solver, damage_model, pset={})

Solution manager

High level solution manager walking through the thermal, structural, and damage calculations.

Parameters:
  • receiver (receiver.Receiver) – receiver object to solve

  • thermal_solver (thermal.ThermalSolver) – how to solve the heat transport

  • thermal_material (materials.ThermalMaterial) – solid thermal properties

  • fluid_material (materials.FluidMaterial) – fluid thermal properties

  • structural_solver (structural.TubeSolver) – how to solve the mechanics problem

  • deformation_material (materials.DeformationMaterial) – how things deform with time

  • damage_material (materials.StructuralMaterial) – how to calculate creep damage

  • system_solver (system.SystemSolver) – how to tie tubes into the structural system

  • damage_model (damage.DamageCalculator) – how to calculate damage from the results

  • pset (Optional[solverparams.ParameterSet]) – optional set of solver parameters

add_heuristic(heuristic)

Add a heuristic to use during the solve

Parameters:

heuristics (list) – new heuristic to add

calculate_damage()

Calculate damage from the results

Returns:

Number of allowed daily cycles

Return type:

float

calculate_reliability_combined(time)

Calculate reliability from the results

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

calculate_reliability_surface_flaw(time)

Calculate reliability from the results

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

calculate_reliability_volume_flaw(time)

Calculate reliability from the results

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

property ntubes

Pass through to get the number of tubes that need to be analyzed

Returns:

total number of tubes in entire receiver

Return type:

int

progress_decorator(base, ntotal)

Either wrap with a progress bar decorator or return a dummy

Parameters:
  • base (function) – base function to wrap

  • ntotal (int) – total number in iterator, needed for wrapping iterators

Returns:

either function wrapped with decorator or base function

solve_heat_transfer()

Solve heat transfer for the receiver

Adds thermal results in each tube

solve_heat_transfer_tube()

Solve the heat transfer problem for each tube

Adds the thermal results to each receiver.Tube object

solve_life()

User interface: solve everything and return receiver life

The trigger for everything: solve the complete problem and report the best-estimate life.

Returns:

Number of allowed daily cycles

Return type:

float

solve_reliability_combined(time)

User interface: solve everything and return receiver reliability

The trigger for everything: solve the complete problem and report the best-estimate reliability.

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

solve_reliability_surface(time)

User interface: solve everything and return receiver reliability

The trigger for everything: solve the complete problem and report the best-estimate reliability.

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

solve_reliability_volume(time)

User interface: solve everything and return receiver reliability

The trigger for everything: solve the complete problem and report the best-estimate reliability.

Parameters:

time (float) – time at which to report reliability

Returns:

Reliability between 0 and 1

Return type:

float

solve_structural()

Solve the structural problem for the complete system

Adds the structural results to each tube.

property tubes

Direct iterator over tubes

Returns:

iterator over tubes

Heuristics

The base assumption in srlife is that the thermal, structural, and damage analyses will use full 3D theories, consider every tube in every receiver, and follow the user provided input (thermal history, structural/spring boundary conditions, etc.) exactly. Solver heuristics modify these base assumptions, with the goal of reducing the time required to complete the analysis at the expense of some accuracy. Heuristics can trigger some action at any point throughout the analysis, in the setup, thermal, structural, or damage phases.

All heuristics inherit from a common base class, srlife.managers.Heuristic.

class srlife.managers.Heuristic

Solution heuristic superclass

Args:

receiver (receiver.receiver): receiver object affected tube (receiver.tube): tube object affected

To implement a specific heuristic override the appropriate pure virtual methods.

args_for_thermohydraulic_solver(receiver)

Add tube solver args

Parameters:

receiver (receiver.receiver) – receiver object affected

args_for_tube_thermal_solver(receiver, tube)

Add tube solver args

Parameters:
  • receiver (receiver.receiver) – receiver object affected

  • tube (receiver.tube) – tube object affected

Cycle reset heuristic

The cycle reset heuristic returns each tube to its initial temperature at the end of every thermal cycle. This heuristic represents the effects of a long hold at lower temperature, often omitted in the analysis. When using transient heat transfer not including this heuristic may mean the tube begin to accumulate a small amount of residual stress, related to any unrelaxed thermal gradient still present at the end of each day.

class srlife.managers.CycleResetHeuristic

Reset the tube temperatures each cycle to the initial values

args_for_thermohydraulic_solver(receiver)

Add tube solver args

Parameters:

receiver (receiver.receiver) – receiver object affected

args_for_tube_thermal_solver(receiver, tube)

Modify the tube solver before the solve

Parameters:
  • receiver (receiver.receiver) – receiver object affected

  • tube (receiver.tube) – tube object affected

ParameterSet description

A srlife.solverparams.ParameterSet is a hierarchical dictionary. The top level dictionary contains global parameters that apply to all solvers, for example

params = solverparams.ParameterSet()
params["nthreads"] = 4

specifies that all solvers can use up to 4 parallel threads. In addition, the top level object contains subdictionaries describing the parameters for the thermal, structural, and receiver system solvers. For example, the code

params["thermal"]["rtol"] = 1.0e-6

sets the relative tolerance of the thermal solver. The tables below provide the options currently available at each level.

Global options

Option

Data type

Default

Explanation

nthreads

int

1

Number of parallel threads to use in solves.

progress

bool

False

Provide progress bar in the command line

Coupled thermal solver options

Option

Data type

Default

Explanation

rtol

float

1.0e-6

Nonlinear solver relative tolerance

atol

float

1.0e-3

Nonlinear solver absolute tolerance

miter

int

1000

Maximum Picard solver iterations

verbose

bool

False

Print debug information to the terminal

eps

float

1.0e-10

Offset from zero for relative tolerance calculation

solid

ParameterSet

empty

Parameters for the solid heat transfer solver

fluid

ParameterSet

empty

Parameters for the thermohydraulic solver

Panel thermalhydraulic solver options

Option

Data type

Default

Explanation

rtol

float

1.0e-6

Nonlinear solver relative tolerance

atol

float

1.0e-8

Nonlinear solver absolute tolerance

miter

int

50

Maximum nonlinear solver iterations

verbose

bool

False

Print debug information to the terminal

Solid temperature solver options

Option

Data type

Default

Explanation

rtol

float

1.0e-6

Nonlinear solver relative tolerance

atol

float

1.0e-2

Nonlinear solver absolute tolerance

miter

int

100

Maximum nonlinear solver iterations

substep

int

1

Divide each higher-level timestep into substep smaller steps

verbose

bool

False

Print debug information to the terminal

steady

bool

False

Use steady state heat transfer, i.e. conduction only

Tube solver options

Option

Data type

Default

Explanation

rtol

float

1.0e-6

Nonlinear solver relative tolerance

atol

float

1.0e-8

Nonlinear solver absolute tolerance

miter

int

10

Maximum nonlinear solver iterations

qorder

int

1

Quadrature order for the finite element method

verbose

bool

False

Print debug information to the terminal

dof_tol

float

1.0e-6

Geometric tolerance for finding nodes on planes

Structural solver options

Option

Data type

Default

Explanation

rtol

float

1.0e-6

Nonlinear solver relative tolerance

atol

float

1.0e-4

Nonlinear solver absolute tolerance

miter

int

25

Maximum nonlinear solver iterations

verbose

bool

False

Print debug information to the terminal

Metallic damage model options

Option

Data type

Default

Explanation

extrapolate

string

“lump”

How to extrapolate damage, options are “lump”, “last”, and “poly”

order

int

1

Polynomial order to use in conjunction with the “poly” option

Ceramic damage model options

Option

Data type

Default

Explanation

cares_cutoff

bool

true

Do not include large compressive stresses in reliability calculation

Class description

class srlife.solverparams.ParameterSet(**kwargs)

Recursive default dictionary that can be pickled

Parameters:

**kwargs – Arbitrary keyword arguments to be added to dictionary

get_default(key, value)

Get a key, if not present return the default value