Skip to content

adam_flume_sinks_object ​

ADAM, FLUME sink particles: the [sinks] input and the replicated sink list (issue #94, M12).

A sink is a point mass with a position, a velocity and an acceleration. The list is replicated: every rank holds every sink and updates it identically from MPI-reduced sums (D-M12-1), so no sink has an owner and none migrates. Sinks act through self-gravity only (D-M12-2): their mass is CIC-deposited into the density the Poisson solver sees and they feel the mesh gravity at their position (the deposit and the gather live in the common object, which owns the grid). The keys, lists of one value per initial sink (their number is that of mass; none: no initial sink):

keyvalue
x, y, zpositions, inside the domain
u, v, wvelocities (optional, default 0)
massmasses, > 0
creationoptional, default .false.: sinks form where the gas meets the Federrath et al. (2010) checks
accretionoptional, default .true.: the sinks accrete the gas above the threshold within their radius
mergingoptional, default .true.: two bound, converging sinks within an accretion radius merge
accretion_radius_cellsoptional, default 2.5: the accretion radius in cells of the sink's level, in [1, ngc]

With runtime regridding ([amr] frequency > 0) the sinks live on the finest level allowed: they form there only, the accretion radius is in its cells and their neighbourhood is kept there at every regrid (D-M12-5).

The threshold density is that of a Jeans length of two accretion radii, rho_thr = pi c_s^2 / (4 G r_acc^2), with the cell's own c_s^2 = gamma p / rho (the Jeans length of the M9 marker; issue #94, D-M12-3, D-M12-4).

With the section, [gravity] self_gravity is required and the model must be hydrodynamic (fatal otherwise, issue #94: MHD sinks are a follow-up). The [reference] layer converts the positions (length), the velocities and the masses (rho0 L0^3). Restart: <restart_basename>.sinks, the list in 17 significant digits (read back, the same doubles). History: <output_basename>-sinks_history.dat, one row per sink per save (it time id m x y z u v w).

Source: src/app/flume/common/adam_flume_sinks_object.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=5)parameterINI section name.

Derived Types ​

flume_sinks_object ​

FLUME sink particles, code units.

Components ​

NameTypeAttributesDescription
is_activelogicalTrue with a [sinks] section.
ninteger(kind=I4P)Sinks number.
mreal(kind=R8P)allocatableMasses [n].
xreal(kind=R8P)allocatablePositions [3,n].
vreal(kind=R8P)allocatableVelocities [3,n].
areal(kind=R8P)allocatableAccelerations from the mesh gravity [3,n].
dt_limitreal(kind=R8P)Time step limit of the current list (refreshed after each update).
is_newlogicalallocatableTrue for a sink formed this step (its first accretion is unchecked).
creationlogicalSinks form from the gas.
accretionlogicalSinks accrete.
merginglogicalSinks merge.
r_acc_cellsreal(kind=R8P)Accretion radius in cells.
formedinteger(kind=I4P)Sinks formed since the start of the run.
mergedinteger(kind=I4P)Mergers since the start of the run.
history_unitinteger(kind=I4P)Sinks history unit (rank 0).

Type-Bound Procedures ​

NameAttributesDescription
appendpass(self)Append a sink.
descriptionpass(self)Return pretty-printed object description.
removepass(self)Remove a sink.
load_from_filepass(self)Load [sinks].
load_restartpass(self)Load the list from .sinks.
open_historypass(self)Open the sinks history (rank 0).
save_historypass(self)Write one history row per sink (rank 0).
save_restartpass(self)Save the list to .sinks (rank 0).
totalspass(self)Return the total mass, momentum and kinetic energy.

Subroutines ​

append ​

Append a sink (every rank, identically: the list is replicated); it is new until its first accretion. The arrays grow by explicit allocation (no reallocation on assignment: under nvfortran it intermittently failed to grow an array in the sink code, issue #94).

fortran
subroutine append(self, m, x, v)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inoutSinks.
mreal(kind=R8P)inMass.
xreal(kind=R8P)inPosition.
vreal(kind=R8P)inVelocity.

Call graph

remove ​

Remove sink s (every rank, identically), by explicit allocation (see append).

fortran
subroutine remove(self, s)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inoutSinks.
sinteger(kind=I4P)inSink to remove.

Call graph

load_from_file ​

Load [sinks] and check it.

fortran
subroutine load_from_file(self, file_parameters, model, self_gravity, domain_emin, domain_emax, ngc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inoutSinks.
file_parameterstype(file_ini)inSimulation parameters ini file handler.
modelinteger(kind=I4P)inPhysical model id.
self_gravitylogicalin[gravity] self_gravity.
domain_eminreal(kind=R8P)inDomain minimum abscissa.
domain_emaxreal(kind=R8P)inDomain maximum abscissa.
ngcinteger(kind=I4P)inGhost cells number (bounds the accretion radius).

Call graph

load_restart ​

Load the list from <basename>.sinks (every rank reads it: the list is replicated).

fortran
subroutine load_restart(self, basename)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inoutSinks.
basenamecharacter(len=*)inRestart files basename.

Call graph

open_history ​

Open the sinks history (rank 0) and write its header (append, without header, on restart).

fortran
subroutine open_history(self, output_basename, is_restart)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inoutSinks.
output_basenamecharacter(len=*)inOutput files basename.
is_restartlogicalinRestarted run flag.

Call graph

save_history ​

Write one history row per sink (rank 0), the values times the output factors.

fortran
subroutine save_history(self, it, time, length, velocity, mass)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inSinks.
itinteger(kind=I4P)inTime iteration.
timereal(kind=R8P)inTime (output units).
lengthreal(kind=R8P)inOutput factor of the lengths.
velocityreal(kind=R8P)inOutput factor of the velocities.
massreal(kind=R8P)inOutput factor of the masses.

Call graph

save_restart ​

Save the list to <basename>.sinks (rank 0), 17 significant digits: read back, the same doubles.

fortran
subroutine save_restart(self, basename)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inSinks.
basenamecharacter(len=*)inRestart files basename.

Call graph

totals ​

Return the total mass, momentum and kinetic energy of the sinks.

Attributes: pure

fortran
subroutine totals(self, mass, momentum, kinetic)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inSinks.
massreal(kind=R8P)outTotal mass.
momentumreal(kind=R8P)outTotal momentum.
kineticreal(kind=R8P)outTotal kinetic energy.

Call graph

Functions ​

description ​

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_sinks_object)inSinks.

Call graph