dumux issueshttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/issues2024-02-16T08:57:42Zhttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/issues/1356[test][porousmediumflow][2pncmin][nonisothermal] Neumann flux at top has to b...2024-02-16T08:57:42ZAnna Mareike Kostelecky[test][porousmediumflow][2pncmin][nonisothermal] Neumann flux at top has to be adaptedWithin in the [non-isothermal 2pncmin test](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/tree/master/test/porousmediumflow/2pncmin/nonisothermal?ref_type=heads) a few things for the Neumann BC at the top should be adapted:...Within in the [non-isothermal 2pncmin test](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/tree/master/test/porousmediumflow/2pncmin/nonisothermal?ref_type=heads) a few things for the Neumann BC at the top should be adapted:
1. In the upwind term ([here](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal/problem.hh?ref_type=heads#L239)) the reference mass-specific density of air is used, but there should be the molar density of air.
With the mass-specific density $\rho = 1.2 ~\text{kg}/\text{m}^3$ and the molar mass of air $M=28.96 * 10^{-3} ~\text{kg}/\text{mol}$, we have $\rho^{\text{mol}}=\rho/M \approx 41,44 ~\text{mol}/\text{m}^3$
2. The density of air (e.g. [here](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal/problem.hh?ref_type=heads#L231)) for the liquid flux should generally be harmonic averaged if CCFV is used with TPFA and arithmetic averaged for box method (as flux for liquid phase is purely diffusive and we do upwind just for advective processes)
3. The comments for "gas flux in/out" ([here](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal/problem.hh?ref_type=heads#L246)) should be switched.
4. For the energy exchange the harmonic mean of the effective heat conductivity within the porous medium and the heat conductivity within the free-flow should be taken. (Note, that applying the same harmonic averaging for the diffusion coefficient is counter-productive as the effective diffusion coefficient, using Millington-Quirk, is small for highly water-saturated porous media. This would lead to a lower evaporation rate for highly water saturated porous-media in comparison to high evaporation rates for almost dried-out porous media. Hence, only the pure binary diffusion coefficient is taken - It could be scaled e.g. linearly with the porosity)https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/issues/1301[porousmediumflow][2pncmin] Use correct time step size for problem file2023-12-11T14:53:06ZAnna Mareike Kostelecky[porousmediumflow][2pncmin] Use correct time step size for problem fileIn the [2pncmin](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal) test the time step size is used in the [problem](https://git.iws.uni-stuttgart.de/dumux-repositories/du...In the [2pncmin](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal) test the time step size is used in the [problem](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal/problem.hh?ref_type=heads#L331) for calculating the amount of precipitating salt per time. For this the time step is set in the [main file](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/test/porousmediumflow/2pncmin/nonisothermal/main.cc?ref_type=heads#L140) at the beginning of each new time step. For this case this works so far.
However, @Simon Grether pointed out that for simulations where the [newton solver](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/nonlinear/newtonsolver.hh?ref_type=heads#L340) does not converge and hence reduces the time step, this is not correctly implemented. This modification of the time step is not accounted for in the problem file, when just setting the time step once in the time loop.
Hence this would be nice to adapt already in the 2pncmin test, such that if this test case is copied and gets modified there is one possible error source less.3.9https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/issues/761Cleanup explicit flash of implicit 2p2c model2023-02-22T08:57:13ZBeatrix BeckerCleanup explicit flash of implicit 2p2c modelThe volumevariables of the 2p2c model have an explicit flash directly implemented in the volumevariables itself.
* In general I like the idea of a specialized 2p2c flash that is easy to understand and fast, but it shouldn't be included...The volumevariables of the 2p2c model have an explicit flash directly implemented in the volumevariables itself.
* In general I like the idea of a specialized 2p2c flash that is easy to understand and fast, but it shouldn't be included in the volumevariables. I would propose implementing it as a separate class in a separate header, like the other constraintsolvers.
* The flash is only used if `useConstraintSolver` is false and the default is true. For the 2p2c model I would make the flash the default, since it is a faster calculation than using the more general `MiscibleMultiPhaseComposition` constraintsolver which solves a linear system of equations. Maybe we should even completely delete `useConstraintSolver` because in my opinion the solver has no benefit here, it solves the same equations, just less efficiently.
* For the case of one phase we may use the `ComputeFromReferencePhase` constraintsolver since it does exactly what the flash does.
* I don't think the flash is currently tested, so this should be added. It should have the same result as the other constraintsolvers.
What do you think? Another solution could be to delete the flash code and always use the solvers that we already have, but as mentioned above, I prefer having a 2p2c-specific flash.
There are a few points that I'm not sure of, maybe @holle can comment on this:
* In my opinion this flash is not as correct as it could be because it uses the assumption that vapor pressure of the liquid component and partial pressure of the liquid component in the gas phase are the same. This is only the case if we neglect the presence of other components in the gas phase. There is an equally quick method to calculate the mass fractions without using this assumption, see the 2p2c flash of the sequential models (note: pre release 3.4)
* It seems that the flash assumes that we deal with one liquid and one gas phase and that the liquid phase is the first phase. I think the 2p2c flash of the sequential models doesn't have this constraint.
* There seems to be a bug in the case that only the first phase is present, in the calculation of the mole fraction of the first component in the second phase. A multiplication with the mole fraction of the first component in the first phase is probably missing.