Assumption of constant molar density
Many things in the current code are based on the assumptions that the phase molar density is constant. However this is not explicitly seen in the code. In fact, we even compute the molar density from the mass density (in which we often use a constant molar density to compute it). Also the assumption that the diffusive flux of a component k in a phase a in equal to minus the diffusive flux of component a in phase a follows from the assumption of constant molar density. However molar density is not only a function of composition (which might be neglected for dilute solution) but also of temperature and density.
I propose to implement it in a way that we never make the assumption of constant molar density. We then should * compute the mass density from the molar density (explicitly using the method returning the molar density),
compute selfdiffusion of water in water / air in air always add up the diffusive fluxes to the total mass/mole balance (they generally don't cancel out)
 put the molar density inside the gradient in Fick's law ???
 implement molarDensity
and self diffusion coefficientmethod in all components
I think this might be necessary to simulate highly concentrated solutions like brine.

Master
compute selfdiffusion of water in water / air in air
then you need to find the diffusion coefficient of water in water (good luck)
always add up the diffusive fluxes to the total mass/mole balance (they generally don't cancel out)
I think this is already done, the only model which uses massbased calculation with a total mass balance are the freeflow and multidomain models
I think this might be necessary to simulate highly concentrated solutions like brine.
What do you mean by 'highly concentrated'? If you mean 'highly diluted', OK. But four large concentrations, Ficks Law doesn't hold. Maybe that is the reason for all our problems...
Maybe it should be clearer where we rely on Fick's assumption and this might be not correct.

Master
selfdiffusion coefficients are wellknown as far as I can tell.
the total balance problem occurs for both mass and mole balances and is used in all models.
I don't know if Fick assumes constant molar densities. I don't think so. So this is a different assumption on top. I agree that the problem definitely comes from that these assumptions are not clear in the code.
If we want to replace Fick's law with something more fancy as Katharina is thinking then we can't just assume something less general in the general part of the code

Master
One possibility might be that the Fluidsystem has a
molarDensityIsConstant
method/struct that can be evaluated at compile time. It can then be used in all the places needed to decide about simplifications. 
changed the description
Toggle commit list 
Master
I found some useful resources here: http://web.unideb.hu/zerdelyi/diffusiononthenanoscale/volumediffusion/
Maybe this could help for further discussion.

Master
Do we really need to account for selfdiffusion? As far as I understood this is a purely random process, not driven by any gradient.
What is the use of modeling selfdiffusion in our context anyway?

changed the description
Toggle commit list