public function outflow_flow_rate_correction(self, u, out_vel, y_weights) result(flow_rate_diff)
The flow_rate_diff for the X_FACE stamp of field_set_face_from_field
that makes the flow rate out equal the flow rate in exactly, as the
pressure projection sees them. The x staggered derivative sums to
(u(nx) - u(1))/dx over the cells, so only the two face planes enter,
each weighted over y by y_weights: the case passes the weights of the
y interpolation (1/2 on a non-periodic boundary plane, 1 elsewhere),
with 0 on any plane it overwrites with the same value on both faces
after the stamp. The stamp is linear in u,
u(nx) <- (1 - c)u(nx) + cu(nx - 1) + flow_rate_diff, so the sums of
the planes before it give the outlet flow rate after it. Call it with
u as it is about to be stamped, once bc_start_u_x holds this substep's
inlet plane. Assumes x is not decomposed, as compute_outflow_params
does.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.