dumux merge requestshttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests2023-06-23T19:04:32Zhttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2796WIP [citation] Draft2023-06-23T19:04:32ZTimo Kochtimokoch@math.uio.noWIP [citation] Drafthttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2767fix conservation of 2p tracer2022-03-28T09:30:24ZBernd Flemischfix conservation of 2p tracerAdd a function `equilibrateTracer` which is called after each
update of the flow solution. It adapts the tracer mole fraction
according to the change in phase distribution such that the amount
of tracer in each element is conserved.
Fix...Add a function `equilibrateTracer` which is called after each
update of the flow solution. It adapts the tracer mole fraction
according to the change in phase distribution such that the amount
of tracer in each element is conserved.
Fixes #1071.https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2563[components] Add component LinearizedH2O2024-06-21T07:22:25ZTimo Kochtimokoch@math.uio.no[components] Add component LinearizedH2OFixes #1013
I hope this is consistent. Water vapor is modeled as an ideal gas. inner energy and vapor pressure are linearized around the reference state. The evaporation enthalpy should be automatically included now.
I added a new com...Fixes #1013
I hope this is consistent. Water vapor is modeled as an ideal gas. inner energy and vapor pressure are linearized around the reference state. The evaporation enthalpy should be automatically included now.
I added a new component as this implementation will probably yield different results than SimpleH2O.X.XTimo Kochtimokoch@math.uio.noTimo Kochtimokoch@math.uio.nohttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2519WIP Feature/new assembler2023-06-13T16:46:51ZDennis GläserWIP Feature/new assemblerhttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2494WIP Test/nonisothermal2023-07-24T13:12:10ZTimo Kochtimokoch@math.uio.noWIP Test/nonisothermalSee !2473. Based on !2471
Shows ~~unphysical~~ temperature gradient. Edit: This is expected. Even for an incompressible fluid viscous dissipation leads to small temperature changes. However, this term is not correctly implemented (see ...See !2473. Based on !2471
Shows ~~unphysical~~ temperature gradient. Edit: This is expected. Even for an incompressible fluid viscous dissipation leads to small temperature changes. However, this term is not correctly implemented (see #1256)
![Screenshot_2021-03-02_at_14.00.47](/uploads/97d41ded8307b900fa2ea99a54400903/Screenshot_2021-03-02_at_14.00.47.png)
* [x] See if we can get a better solution by adding $`\vec{v}\cdot\nabla p`$ in the energy balance somehow
Edit: adding this term leads to ignoring viscous dissipation. But does not correct the original mistake in the implementation (see #1256)
~~For incompressible fluids we have at least two options:~~
~~* Assemble internal energy fluxes instead of enthalpy fluxes, the volume work term disappears (not generic)~~
~~* Add the missing term and keep assembling enthalpy fluxes~~
The solution is to include the gravity contribution (see #1256)https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/2253[WIP] Feature/nonlinear schemes2023-07-20T13:17:36ZTimo Kochtimokoch@math.uio.no[WIP] Feature/nonlinear schemeshttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/1989[WIP] [linear] Add first draft of SIMPLE preconditioner2023-11-28T14:57:40ZKilian Weishaupt[WIP] [linear] Add first draft of SIMPLE preconditioner__SIMPLE__
Goal: solve
```math
\begin{pmatrix}
A & B\\
C & D
\end{pmatrix}
\begin{pmatrix}
u\\
p
\end{pmatrix}
=
\begin{pmatrix}
f\\
g
\end{pmatrix}
```
__Equations__
Exact velocity: $`~~~~~~u = u^* + \delta u ~~~~~~~ (1)`$
Ex...__SIMPLE__
Goal: solve
```math
\begin{pmatrix}
A & B\\
C & D
\end{pmatrix}
\begin{pmatrix}
u\\
p
\end{pmatrix}
=
\begin{pmatrix}
f\\
g
\end{pmatrix}
```
__Equations__
Exact velocity: $`~~~~~~u = u^* + \delta u ~~~~~~~ (1)`$
Exact pressure: $`~~~~~~p = p^* + \delta p ~~~~~~~ (2)`$
Exact velocity equation: $`~~~~~~A u + B p = f ~~~~~~~ (3)`$
Approximate velocity equation using some pressure guess $`p^*`$: $`~~~~~~A u^* + B p^* = f ~~~~~~~ (4)`$
Substract: (3-4) : $`~~~~~~A (u - u^*) + B (p-p^*) = 0 ~~~~~~~ (5)`$
$`~~~~~~A \delta u + B \delta p = 0 ~~~~~~~ (6)`$
Assumption (SIMPLE): $`~~~~~~diag(A) \approx A ~~~~~~~ (7)`$
Rearrange (6) and insert (7): $`~~~~~~\delta u = - diag(A)^{-1} B \delta p~~~~~~~ (7)`$
Mass conservation: $`~~~~~~C u = g~~~~~~~ (8)`$
$`~~~~~~C (u^* + \delta u) = g~~~~~~~ (9)`$
$`~~~~~~C (u^* + - C diag(A)^{-1} B \delta p) = g~~~~~~~ (10)`$
$`~~~~~~C u^* = g + C diag(A)^{-1} B \delta p~~~~~~~ (11)`$
Schur complement $`~~~~~~C diag(A)^{-1} B \delta p = C u^* - g ~~~~~~~ (12)`$
__Algorithm__
1.) Solve (4) for $`u^*`$
2.) Solve (12) for $`\delta p`$
3.) Get $`\delta u`$ from (7)
4.) update $`p=p^* + \alpha \delta p`$
5.) update $`u= u^* +\delta u`$
Naive implementation of https://www.cs.umd.edu/~elman/papers/tax.pdf
Converges, but is slower than Uzawa.
The internal GMRES solver to invert the Schur complement is not preconditioned yet (Richardson, w = 1).
Richardson seems to be the only preconditioner that does not require an assembled matrix.
Maybe we can write our own Jacobi preconditioner? If one can apply the action of the Schur complement without a matrix (what we do right now), is it also possible to apply the inverse of its diagonal without having the matrix?
__Udpate__ : There seem to be various matrix-free preconditioning methods
http://www2.cs.cas.cz/~tuma/ps/cutu06.pdf
https://hal.inria.fr/inria-00074080/document
http://www2.cs.cas.cz/semincm/lectures/2009-05-15-DuintjerTebbens.pdf
https://arxiv.org/pdf/1805.11930.pdf
https://arxiv.org/pdf/2006.06052.pdf
https://gitlab.dune-project.org/exadune/exadune-appl/-/blob/feature/blockiterative-preconditioner-FlexibleGMRES/src/blockiterativesolver/blockdiagonalpreconditioner.hh
A very simple (and probably expensive) option to test if preconditioning helps inverting the approximate Schur $`\tilde{S}`$ complement would be
```math
\tilde{S}^{-1}_{0,0} = \left(\tilde{S} \cdot (1, 0, ... ,n)^T \right) \cdot (1, 0, ... ,n)^T \\
\tilde{S}^{-1}_{1,1} = \left(\tilde{S} \cdot (0, 1, ... ,n)^T \right) \cdot (0, 1, ... ,n)^T \\
....
```
With that, one could construct a Jacobi preconditioner after doing n matrix vector operations.https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/1821[WIP][md] Implement box staggered coupling2024-06-05T12:52:30ZKilian Weishaupt[WIP][md] Implement box staggered couplingTodos:
- [x] Add test for segment-segment intersection algorithm
- [x] Make segment-segment intersection algorithm more efficient
- [x] Put segment-segment in different MR
- [x] Extract Box-Forchheimer to separate MR
- [x] New BJ test ...Todos:
- [x] Add test for segment-segment intersection algorithm
- [x] Make segment-segment intersection algorithm more efficient
- [x] Put segment-segment in different MR
- [x] Extract Box-Forchheimer to separate MR
- [x] New BJ test (existing test uses indefinite perm. matrix)
- [x] Change convergence script to specify convergence rate
- [ ] It currently only works for `DiffusionCoefficientAveragingType::ffOnly`
- [ ] Maxwell Stefan Diffusion law not yet implemented when using Box
- [ ] Renaming: Use ff/pm instead of stokes/darcy
- [ ] New IC assume specific parameter group "Darcy", generalise this
- [ ] Add missing tests
Suggestions:
- [x] Currently, we retrieve the entire context via `couplingContextVector()`, but the old interface is still there. I would shrink this to only one interface and probably rename it. Currently, there is one context object per coupling segment, so maybe we can find a better name.
- [x] At the moment the coupling segment geometry is stored in both the darcy and the stokes coupling info objects in the mapper. I don't think this is the most memory consuming part of the code, but there is room for memory efficiency improvements.
Fixes #788.Martin SchneiderMartin Schneiderhttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/1716WIP: Feature/explicit flashs of compositional models2023-02-22T19:17:52ZBeatrix BeckerWIP: Feature/explicit flashs of compositional models**What this MR does / why does DuMux need it**:
Introduces a 2p2c-specific constraint solver, that explicitly calculates mass fractions for two-phase state, assuming ideal mixtures (as does the generic mpnc constraint solver for two-phas...**What this MR does / why does DuMux need it**:
Introduces a 2p2c-specific constraint solver, that explicitly calculates mass fractions for two-phase state, assuming ideal mixtures (as does the generic mpnc constraint solver for two-phase state).
Changes in volumevariables: The new constraint solver is used for two-phase state. In the one-phase state the `ComputeFromReferencePhase` solver is used, since it does the simplest thing possible for ideal mixtures.
`useConstraintSolver` is deleted because it's not needed anymore.
Resolves #761
**Special notes for your reviewer**:
Is it okay to have a new header for the 2p2c-specific constraint solver or should I integrate it as a special case in the generic one? I guess this is not backward compatible (deleted `useConstraintSolver`)? Do I have to deprecate the entire old volumevariables? @holle : The 2p2c tests parse with the new constraint solver (they did so before with the old, in my opinion slightly less correct/buggy version, too, although that was never tested...). Does it look good to you, too?Holger ClassHolger Classhttps://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/merge_requests/1703WIP Feature/multidomain analytic jac2024-09-03T13:35:51ZTimo Kochtimokoch@math.uio.noWIP Feature/multidomain analytic jacDennis GläserDennis Gläser