sailfish.setups.exploding_star.ExplodingStar

class sailfish.setups.exploding_star.ExplodingStar(**kwargs)[source]

Bases: SetupBase

A star exploding.

The model is based on Duffell & MacFadyen (2015). Code was adapted from Marcus Dupont’s setup in Simbi.

__init__(**kwargs)

Methods

__init__(**kwargs)

checkpoint_diagnostics(time)

Return a dict of post-processing data to include in checkpoint files.

dash_case_class_name()

Return a dash-case name of this setup class.

default_model_parameters()

Return an iterator over the default model parameters for this class.

describe_class()

Print formatted text describing the setup.

find_setup_class(name)

Finds a setup class with the given name.

has_model_parameters()

Determine if this class has any model parameters.

immutable_parameter_keys()

Return an iterator over the immutable model parameter keys.

mesh(num_zones_per_decade)

Return a mesh instance describing the problem domain.

model_parameter_dict()

Return a dictionary of the model parameters.

model_parameters()

Return an iterator over the model parameters chosen for this setup.

primitive(t, r, primitive)

Approximate density profile of a MESA star.

print_model_parameters([logger, newlines])

Print parameter names, values, and about messages to stdout.

validate()

Confirm that the model parameters are physically valid.

Attributes

boundary_condition

Return a boundary condition mode.

default_end_time

Provide a default end-time to the simulation driven.

default_resolution

Provide a default grid resolution.

diagnostics

A list of diagnostics to be dispatched to the solver.

physics

Return physics parameters used by the solver: EOS, gravity, etc.

r_inner

r_outer

r_shell

reference_time_scale

The time scale used to convert raw simulation time to user time.

solver

Return the name of the setup class.

start_time

The start time for the simulation.

property boundary_condition

Return a boundary condition mode.

This method must be overridden, and the mode must be supported by the solver. 1D solvers should accept either a single return value specifying the BC mode at both the domain edges, or a pair of modes, one for each edge.

checkpoint_diagnostics(time)

Return a dict of post-processing data to include in checkpoint files.

An example use case is to record the positions of point masses (with prescribed trajectory) in a gravitating hydrodynmics problem.

classmethod dash_case_class_name()

Return a dash-case name of this setup class.

Dash case is used in configuration, including the setup name passed to the driver, and written in checkpoint files.

property default_end_time

Provide a default end-time to the simulation driven.

This value will be superceded if a non-None end time was provided to the driver. If neither the driver nor the setup has an end time, then the simulation runs until it’s killed.

classmethod default_model_parameters()

Return an iterator over the default model parameters for this class.

property default_resolution

Provide a default grid resolution.

classmethod describe_class()

Print formatted text describing the setup.

The output will include a normlized version of the class doc string, and the model parameter names, default values, and about message.

property diagnostics

A list of diagnostics to be dispatched to the solver.

classmethod find_setup_class(name)

Finds a setup class with the given name.

The class name is expected in dash-case format. If no setup is found, a SetupError exception is raised.

classmethod has_model_parameters()

Determine if this class has any model parameters.

classmethod immutable_parameter_keys()

Return an iterator over the immutable model parameter keys.

mesh(num_zones_per_decade)[source]

Return a mesh instance describing the problem domain.

This method must be overridden, and the domain type must be supported by the solver. A resolution parameter is passed here from the driver.

model_parameter_dict()

Return a dictionary of the model parameters.

model_parameters()

Return an iterator over the model parameters chosen for this setup.

property physics

Return physics parameters used by the solver: EOS, gravity, etc.

Physics parameters should be distinct from the solver options, such as PLM theta value, RK integration type, or DG order.

primitive(t, r, primitive)[source]

Approximate density profile of a MESA star.

Numerical values are from Table 1 of DM15.

print_model_parameters(logger=None, newlines=False)

Print parameter names, values, and about messages to stdout.

property reference_time_scale

The time scale used to convert raw simulation time to user time.

Typically the reference time can be 1.0, meaning that raw simulation time and user time are the same. However it sometimes makes sense for the user time to be something else, like the orbital period of 2 pi for example. The start_time and default_time_time properties are in uner time, not raw simulation time. Similarly, messages written to stdout, and event recurrences are both in user time, i.e. if the reference time is 2 pi and –checkpoint=1.0, you’ll get one checkpoint written per orbital period. The “time” field of the checkpoint file contains the raw simulation time, not the user time.

property solver

Return the name of the setup class.

property start_time

The start time for the simulation. This is 0.0 by default.

validate()

Confirm that the model parameters are physically valid.

This method should be overridden to indicate a failure by throwing a SetupError exception.