Repository navigation
Conversation
| Model | What it adds | Why |
|---|---|---|
| `TwoPointDirichlet` | The two-point flux from a cell's centroid to a boundary value, $`\sum_{F \subset \Gamma} \int_F \frac{\kappa}{\delta_K} (u - g)\, w \,\mathrm{d}s`$ | Split out of `TwoPointFlux`, so a boundary value is its own model, as `NitscheDirichlet` is for `WeightedInteriorPenalty`. A closed boundary leaves it out. |
| `NonOrthogonalDirichletCorrection` | The non-orthogonal correction on boundary facets with a value, $`-\sum_{F \subset \Gamma} \int_F \kappa\, \mathbf{k}_\Gamma \cdot \mathbf{G}\, w \,\mathrm{d}s`$ | The boundary half of `NonOrthogonalCorrection`, needed only where `TwoPointDirichlet` is |
| `LeastSquaresDirichletMisfit` | The fit of the cell gradient $`\mathbf{G}_K`$ to the boundary value $`g`$ at the facet point $`\mathbf{x}`$ | The boundary half of `LeastSquaresMisfit` |
| `LeastSquaresNeumannMisfit` | The fit of $`\mathbf{n} \cdot \mathbf{G} = 0`$ on walls, $`\sum_{F \subset \Gamma_N} \frac{1}{2} (\mathbf{n} \cdot \mathbf{G}_K)^2`$ | Without it, a cell in a wall corner can lack neighbours in enough directions, which leaves $`\mathbf{G}_K`$ undetermined (the half-cell's walls and outlet) |
| `NormalVelocityJump` | $`j(u, w) = \sum_F \int_F [\![\boldsymbol{\beta}]\!] \cdot \mathbf{n}\, \lbrace u\, w \rbrace \,\mathrm{d}s`$ | The facet part of the divergence of a discontinuous discrete velocity, e.g. $`-K/\mu\, \nabla p_h`$ of a P1 pressure, whose divergence inside each cell is zero |
| `DivergenceCorrection` | The sum of a `Source` of $`u\, \nabla \cdot \boldsymbol{\beta}`$ and `NormalVelocityJump` | Removes the source that a discrete flow with $`\nabla \cdot \boldsymbol{\beta}_h \neq 0`$ adds to the conservative upwind form. Without it, a uniform concentration piles up where a Taylor–Hood or Darcy flow converges. With it, the conservative form equals the convective one for any velocity. The DG half-cell needs this because its migration drift must stay conservative. |
The correction removes
$$
s(u, w) = \sum_K \int_K u\, \nabla \cdot \boldsymbol{\beta}\, w \,\mathrm{d}x - \sum_F \int_F [\![\boldsymbol{\beta}]\!] \cdot \mathbf{n}\, \lbrace u\, w \rbrace \,\mathrm{d}s,
$$
the difference between the conservative and the convective upwind forms, found by summation by parts.
## Changed (breaking)
- `TwoPointFlux`, `NonOrthogonalCorrection` and `LeastSquaresMisfit` now hold only the interior-facet terms. Their boundary arguments (`value`, `markers`) moved to the Dirichlet models above, so that each model is one term.
- Terms pair with the test function through `ufl.inner`, and the misfits square as $`\mathrm{inner}(e, e)`$, the sumfem convention. The forms are unchanged in real mode.
## Tests
- The two-point comparison against plain UFL sums all six DG0 pieces.
- The least-squares gradient of $`u = x`$ is $`(1, 0)`$ in every cell when the walls are fitted.
- Conservative form + `DivergenceCorrection` equals the convective form for a constant, a diverging and a piecewise-constant velocity.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New models
Generic
InteriorFluxBoundaryMisfit(inmodels/boundary.py)NormalVelocityJumpDivergenceCorrectionSourceofNormalVelocityJumpBoundary terms of piecewise constants
TwoPointDirichlet(aBoundaryFlux)TwoPointFlux. A closed boundary leaves it out.NonOrthogonalDirichletCorrection(aBoundaryFlux)NonOrthogonalCorrectionLeastSquaresDirichletMisfit(aBoundaryMisfit)LeastSquaresMisfitLeastSquaresNeumannMisfit(aBoundaryMisfit)The correction removes
the difference between the conservative and the convective upwind forms, found by summation by parts.
Changed (breaking)
TwoPointFlux,NonOrthogonalCorrectionandLeastSquaresMisfitnow hold only the interior-facet terms. Their boundary arguments (value,markers) moved to the boundary models above.TwoPointFlux,UpwindFluxandNonOrthogonalCorrectionare subclasses ofInteriorFlux, andInflowBoundaryis a subclass ofBoundaryFlux. Their forms are unchanged.ufl.inner, and the misfits square asTests
DivergenceCorrectionequals the convective form for a constant, a diverging and a piecewise-constant velocity.