FS#159 Unification of common flux variables capabilities
Metadata
Description
Let us chase a new pig through the village, and I would like to thank Philipp for bringing this up: There is a lot of unification potential for the flux variables. I propose two stages:
1. Establish a base class, e.g. BoxFluxVariables providing and implementing the following interface:
face():
The (sub-control-volume) face to which the flux variables are referring.
up/downstreamIdx(int phaseIdx):
Obvious. We could default phaseIdx to 0 admitting a shortcut for single-phase models.
normalVelocity(int phaseIdx):
The normal component of the phase velocity. A default implementation using Darcy\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'s law is provided which can be used by all standard porous media models. It could be overwritten by e.g. Stokes or extended by the possibility to use Forchheimer.
These are the only face quantities which are necessary for calculating the advective fluxes. Inheriting the model-specific flux variables from the base would greatly simplify all box flux variables. Plus greatly simplify the calculation of the advective fluxes in the computeFlux routine.
This sounds great, but there is a catch: for the calculation of Darcy\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'s velocity, one has to upwind the mobility. For the calculation of the mass or enthalpy fluxes afterwards, one has to upwind again, e.g. density. If the upwind weight alpha is different from 1, this gives a different result as we would currently get. I think we can live with this since we anyway almost never choose the upwind weight different from 1. It also is rather a matter of interpretation than doing something better or worse.
2. Diffusive fluxes: This will require a bit more discussion, since this is handled rather differently among the individual models. We should discuss this after finishing 1.
Please contribute your thoughts.