Simulation
- class dustpy.Simulation(**kwargs)[source]
Bases:
Frame
The main simulation class for running dust coagulation simulations.
dustpy.Simulation` is a child of
simframe.Frame
.For setting simple initial conditions use
Simulation.ini
, For making the simulation grids useSimulation.makegrids()
, For initialization useSimulation.initialize()
, For running simulations useSimulation.run()
.Please have a look at the documentation of
simframe
for further details.- Attributes:
description
Description of the instance.
ini
Parameter set for setting the initial conditions.
integrator
Integrator
that controls the simulation.progressbar
Progressbar
for displaying current status.toc
Complete table of contents starting from this object.
updateorder
Update order if updater was set with list of strings.
updater
Heartbeat
object with update instructions.verbosity
Verbosity of the
Frame
objects.writer
Writer
object for writing output files.
Methods
addfield
(name, value[, updater, ...])Function to add a new
Field
to the object.addgroup
(name[, updater, description])Function to add a new
Group
to the object.addintegrationvariable
(name, value[, ...])Function to add a new integration variable
IntVar
to the object.Function checks for mass conservation and prints the maximum relative mass error.
Function initializes the simulation frame.
Function creates radial and mass grid.
memory_usage
([print_output, skip_hidden])Determine memory usage of a Group
run
()This functions runs the simulation.
setdustintegrator
([scheme, method])Function sets the dust integrator.
update
(*args, **kwargs)Function to update the object.
writeoutput
([i, forceoverwrite, filename])Writes output to file, if
Writer
is specified.Attributes Summary
Parameter set for setting the initial conditions.
Methods Summary
Function checks for mass conservation and prints the maximum relative mass error.
Function initializes the simulation frame.
Function creates radial and mass grid.
run
()This functions runs the simulation.
setdustintegrator
([scheme, method])Function sets the dust integrator.
Attributes Documentation
- ini
Parameter set for setting the initial conditions.
Methods Documentation
- checkmassconservation()[source]
Function checks for mass conservation and prints the maximum relative mass error.
- initialize()[source]
Function initializes the simulation frame.
Function sets all fields that are None with a standard value. If the grids are not set, it will call
Simulation.makegrids()
first.
- makegrids()[source]
Function creates radial and mass grid.
Notes
The grids are set up with the parameters given in
Simulation.ini
. If you want to have a custom radial grid you have to set the array of grid cell interfacesSimulation.grid.ri
, before callingSimulation.makegrids()
. You cannot have a customized mass grid, because the coagulation alorithm strictly needs a logarithmic grid. Always set your mass grid parameters withSimulation.ini
.
- setdustintegrator(scheme='explicit', method='cash-karp')[source]
Function sets the dust integrator.
- Parameters:
scheme (string, optional, default : "explicit") –
- Possible values
{“explicit”, “implicit”}
method (string, optional, default : "cash-karp") –
- Possible values for explicit integration
{“cash-karp”}
- Possible values for implicit integration
{“direct”, “gmres”, “bicgstab}