sailfish.physics.circumbinary.Physics
- class sailfish.physics.circumbinary.Physics(eos_type: EquationOfState = EquationOfState.GLOBALLY_ISOTHERMAL, sound_speed: float = 1.0, mach_number: float = 10.0, gamma_law_index: float = 1.6666666666666667, viscosity_model: ViscosityModel = ViscosityModel.NONE, viscosity_coefficient: float = 0.0, alpha: float = 0.0, buffer_is_enabled: bool = False, buffer_driving_rate: float = 1000.0, buffer_onset_width: float = 0.1, point_mass_function: Optional[Callable[[float], List[PointMass]]] = None, cooling_coefficient: float = 0.0, constant_softening: bool = True, diagnostics: List[Diagnostic] = [])[source]
Bases:
NamedTuple
Physics configuration for the binary accretion solvers
Configuration categories are:
Equation of state: globally isothermal, locally isothermal, or gamma-law
In globally isothermal mode, a uniform sound speed is specified. In globally isothermal mode, an orbital mach number is specified, and used to assign the sound speed based on the local gravitational potential (this option only makes sense when gravitating point masses are provided). In gamma-law mode, the sound speed is determined self-consistently from the internal energy. The cbdiso_2d solver only supports the former two modes, and the cbdgam_2d solver only upports the last mode.
Gravitating point masses
Point masses can be optionally provided to model stars or black holes. The point mass properties include a point mass’s mass, and its x-y position. These properties fully determine the gravitational potential sourced by the particle. Point masses can also act as sinks of mass and momentum (see the
PointMass
struct above for details). The point masses are supplied to the solver implicitly through a callback function, mapping the simulation time to a sequence of particles. Currently, solvers support either zero, one, or two particles.Viscosity model
Two different viscosity models are nominally supported: constant-nu, and constant alpha. Currently the isothermal solver only supports constant-nu viscosity.
Thermal cooling
Todo.
An outer buffer zone
For binary accretion problems in a square domain, it can be useful to impose a wave-damping zone (or sponge layer) to avoid artifacts fromt the outer boundary on the orbiting gas. The buffer zone, if enabled, will drive the solution outside a “buffer onset radius” toward an appropriate hydrodynamic state. This should be gas with uniform gas pressure and density (which may be sampled from the initial condition), and that gas should be on circular Keplerian orbits. The
buffer_driving_rate
parameter controls how fast the solution is driven toward the smooth one. The buffer is applied in a region between the domain radius (the half-width of a square domain), extending inwards by an amount specified by thebuffer_onset_width
parameter.
- __init__()
Methods
__init__
()count
(value, /)Return number of occurrences of value.
index
(value[, start, stop])Return first index of value.
point_masses
(time)Generate two point masses from the simulation time and supplied callback.
Attributes
Alpha parameter, if viscosity model is alpha
Rate of driving toward target solution in the buffer region
Whether the buffer zone is enabled
Distance over which the buffer ramps up
If local disk height is ignored in gravitational softening
Strength of the cooling term
Physics diagnostics to be returned when reductions are computed
EOS type: globally or locally isothermal
Adiabatic index, if the EOS type is not isothermal
Square of the Mach number, if EOS type is locally isothermal
num_particles
Callback function to supply point masses as a function of time
Isothermal sound speed, if EOS type is globally isothermal
Kinematic viscosity value (a^2 Omega) if viscosity is nu
Which viscosity model to use (none, nu, alpha)
- alpha: float
Alpha parameter, if viscosity model is alpha
- buffer_driving_rate: float
Rate of driving toward target solution in the buffer region
- buffer_is_enabled: bool
Whether the buffer zone is enabled
- buffer_onset_width: float
Distance over which the buffer ramps up
- constant_softening: bool
If local disk height is ignored in gravitational softening
- cooling_coefficient: float
Strength of the cooling term
- count(value, /)
Return number of occurrences of value.
- diagnostics: List[Diagnostic]
Physics diagnostics to be returned when reductions are computed
- eos_type: EquationOfState
EOS type: globally or locally isothermal
- gamma_law_index: float
Adiabatic index, if the EOS type is not isothermal
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- mach_number: float
Square of the Mach number, if EOS type is locally isothermal
- point_mass_function: Callable[[float], List[PointMass]]
Callback function to supply point masses as a function of time
- point_masses(time)[source]
Generate two point masses from the simulation time and supplied callback.
- sound_speed: float
Isothermal sound speed, if EOS type is globally isothermal
- viscosity_coefficient: float
Kinematic viscosity value (a^2 Omega) if viscosity is nu
- viscosity_model: ViscosityModel
Which viscosity model to use (none, nu, alpha)