MOM6
|
Edge value estimation for high-order resconstruction.
Functions/Subroutines | |
subroutine, public | bound_edge_values (N, h, u, edge_val, h_neglect) |
Bound edge values by neighboring cell averages. More... | |
subroutine, public | average_discontinuous_edge_values (N, edge_val) |
Replace discontinuous collocated edge values with their average. More... | |
subroutine, public | check_discontinuous_edge_values (N, u, edge_val) |
Check discontinuous edge values and replace them with their average if not monotonic. More... | |
subroutine, public | edge_values_explicit_h2 (N, h, u, edge_val, h_neglect) |
Compute h2 edge values (explicit second order accurate) in the same units as h. More... | |
subroutine, public | edge_values_explicit_h4 (N, h, u, edge_val, h_neglect, answers_2018) |
Compute h4 edge values (explicit fourth order accurate) in the same units as h. More... | |
subroutine, public | edge_values_implicit_h4 (N, h, u, edge_val, h_neglect, answers_2018) |
Compute ih4 edge values (implicit fourth order accurate) in the same units as h. More... | |
subroutine, public | edge_values_implicit_h6 (N, h, u, edge_val, h_neglect, answers_2018) |
Compute ih6 edge values (implicit sixth order accurate) in the same units as h. More... | |
Variables | |
real, parameter | hneglect_edge_dflt = 1.e-10 |
The default value for cut-off minimum thickness for sum(h) in edge value inversions. More... | |
real, parameter | hneglect_dflt = 1.e-30 |
The default value for cut-off minimum thickness for sum(h) in other calculations. More... | |
real, parameter | hminfrac = 1.e-5 |
A minimum fraction for min(h)/sum(h) More... | |
subroutine, public regrid_edge_values::average_discontinuous_edge_values | ( | integer, intent(in) | N, |
real, dimension(:,:), intent(inout) | edge_val | ||
) |
Replace discontinuous collocated edge values with their average.
For each interior edge, check whether the edge values are discontinuous. If so, compute the average and replace the edge values by the average.
[in] | n | Number of cells |
[in,out] | edge_val | Edge values that may be modified the second index size is 2. |
Definition at line 141 of file regrid_edge_values.F90.
Referenced by p1m_functions::p1m_interpolation(), and p3m_functions::p3m_limiter().
subroutine, public regrid_edge_values::bound_edge_values | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | h, | ||
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val, | ||
real, intent(in), optional | h_neglect | ||
) |
Bound edge values by neighboring cell averages.
In this routine, we loop on all cells to bound their left and right edge values by the cell averages. That is, the left edge value must lie between the left cell average and the central cell average. A similar reasoning applies to the right edge values.
Both boundary edge values are set equal to the boundary cell averages. Any extrapolation scheme is applied after this routine has been called. Therefore, boundary cells are treated as if they were local extrama.
[in] | n | Number of cells |
[in] | h | cell widths (size N) [H] |
[in] | u | cell average properties (size N) in arbitrary units [A] |
[in,out] | edge_val | Potentially modified edge values [A] |
[in] | h_neglect | A negligibly small width [H] |
Definition at line 48 of file regrid_edge_values.F90.
References hneglect_dflt.
Referenced by p1m_functions::p1m_interpolation(), p3m_functions::p3m_limiter(), ppm_functions::ppm_limiter_standard(), and pqm_functions::pqm_limiter().
subroutine, public regrid_edge_values::check_discontinuous_edge_values | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val | ||
) |
Check discontinuous edge values and replace them with their average if not monotonic.
For each interior edge, check whether the edge values are discontinuous. If so and if they are not monotonic, replace each edge value by their average.
[in] | n | Number of cells |
[in] | u | cell averages (size N) in arbitrary units [A] |
[in,out] | edge_val | Cell edge values [A]. |
Definition at line 174 of file regrid_edge_values.F90.
Referenced by ppm_functions::ppm_limiter_standard(), and pqm_functions::pqm_limiter().
subroutine, public regrid_edge_values::edge_values_explicit_h2 | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | h, | ||
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val, | ||
real, intent(in), optional | h_neglect | ||
) |
Compute h2 edge values (explicit second order accurate) in the same units as h.
[in] | n | Number of cells |
[in] | h | cell widths (size N) [H] |
[in] | u | cell average properties (size N) in arbitrary units [A] |
[in,out] | edge_val | Returned edge values [A]; the second index size is 2. |
[in] | h_neglect | A negligibly small width [H] |
Definition at line 226 of file regrid_edge_values.F90.
References hneglect_edge_dflt.
subroutine, public regrid_edge_values::edge_values_explicit_h4 | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | h, | ||
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val, | ||
real, intent(in), optional | h_neglect, | ||
logical, intent(in), optional | answers_2018 | ||
) |
Compute h4 edge values (explicit fourth order accurate) in the same units as h.
Compute edge values based on fourth-order explicit estimates. These estimates are based on a cubic interpolant spanning four cells and evaluated at the location of the middle edge. An interpolant spanning cells i-2, i-1, i and i+1 is evaluated at edge i-1/2. The estimate for each edge is unique.
i-2 i-1 i i+1
..–o---—o---—o---—o---—o–.. i-1/2
The first two edge values are estimated by evaluating the first available cubic interpolant, i.e., the interpolant spanning cells 1, 2, 3 and 4. Similarly, the last two edge values are estimated by evaluating the last available interpolant.
For this fourth-order scheme, at least four cells must exist.
[in] | n | Number of cells |
[in] | h | cell widths (size N) [H] |
[in] | u | cell average properties (size N) in arbitrary units [A] |
[in,out] | edge_val | Returned edge values [A]; the second index size is 2. |
[in] | h_neglect | A negligibly small width [H] |
[in] | answers_2018 | If true use older, less acccurate expressions. |
Definition at line 289 of file regrid_edge_values.F90.
References polynomial_functions::evaluation_polynomial(), hminfrac, hneglect_edge_dflt, and regrid_solvers::solve_linear_system().
subroutine, public regrid_edge_values::edge_values_implicit_h4 | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | h, | ||
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val, | ||
real, intent(in), optional | h_neglect, | ||
logical, intent(in), optional | answers_2018 | ||
) |
Compute ih4 edge values (implicit fourth order accurate) in the same units as h.
Compute edge values based on fourth-order implicit estimates.
Fourth-order implicit estimates of edge values are based on a two-cell stencil. A tridiagonal system is set up and is based on expressing the edge values in terms of neighboring cell averages. The generic relationship is
\[ \alpha u_{i-1/2} + u_{i+1/2} + \beta u_{i+3/2} = a \bar{u}_i + b \bar{u}_{i+1} \]
and the stencil looks like this
i i+1
..–o---—o---—o–.. i-1/2 i+1/2 i+3/2
In this routine, the coefficients \(\alpha\), \(\beta\), \(a\) and \(b\) are computed, the tridiagonal system is built, boundary conditions are prescribed and the system is solved to yield edge-value estimates.
There are N+1 unknowns and we are able to write N-1 equations. The boundary conditions close the system.
[in] | n | Number of cells |
[in] | h | cell widths (size N) [H] |
[in] | u | cell average properties (size N) in arbitrary units [A] |
[in,out] | edge_val | Returned edge values [A]; the second index size is 2. |
[in] | h_neglect | A negligibly small width [H] |
[in] | answers_2018 | If true use older, less acccurate expressions. |
Definition at line 492 of file regrid_edge_values.F90.
References polynomial_functions::evaluation_polynomial(), hminfrac, hneglect_edge_dflt, regrid_solvers::solve_linear_system(), and regrid_solvers::solve_tridiagonal_system().
Referenced by mom_remapping::build_reconstructions_1d(), mom_ale::pressure_gradient_ppm(), and regrid_interp::regridding_set_ppolys().
subroutine, public regrid_edge_values::edge_values_implicit_h6 | ( | integer, intent(in) | N, |
real, dimension(:), intent(in) | h, | ||
real, dimension(:), intent(in) | u, | ||
real, dimension(:,:), intent(inout) | edge_val, | ||
real, intent(in), optional | h_neglect, | ||
logical, intent(in), optional | answers_2018 | ||
) |
Compute ih6 edge values (implicit sixth order accurate) in the same units as h.
Sixth-order implicit estimates of edge values are based on a four-cell, three-edge stencil. A tridiagonal system is set up and is based on expressing the edge values in terms of neighboring cell averages.
The generic relationship is
\[ \alpha u_{i-1/2} + u_{i+1/2} + \beta u_{i+3/2} = a \bar{u}_{i-1} + b \bar{u}_i + c \bar{u}_{i+1} + d \bar{u}_{i+2} \]
and the stencil looks like this
i-1 i i+1 i+2
..–o---—o---—o---—o---—o–.. i-1/2 i+1/2 i+3/2
In this routine, the coefficients \(\alpha\), \(\beta\), a, b, c and d are computed, the tridiagonal system is built, boundary conditions are prescribed and the system is solved to yield edge-value estimates.
Note that the centered stencil only applies to edges 3 to N-1 (edges are numbered 1 to n+1), which yields N-3 equations for N+1 unknowns. Two other equations are written by using a right-biased stencil for edge 2 and a left-biased stencil for edge N. The prescription of boundary conditions (using sixth-order polynomials) closes the system.
CAUTION: For each edge, in order to determine the coefficients of the implicit expression, a 6x6 linear system is solved. This may become computationally expensive if regridding is carried out often. Figuring out closed-form expressions for these coefficients on nonuniform meshes turned out to be intractable.
[in] | n | Number of cells |
[in] | h | cell widths (size N) [H] |
[in] | u | cell average properties (size N) in arbitrary units [A] |
[in,out] | edge_val | Returned edge values [A]; the second index size is 2. |
[in] | h_neglect | A negligibly small width [H] |
[in] | answers_2018 | If true use older, less acccurate expressions. |
Definition at line 661 of file regrid_edge_values.F90.
References polynomial_functions::evaluation_polynomial(), hminfrac, hneglect_edge_dflt, regrid_solvers::solve_linear_system(), and regrid_solvers::solve_tridiagonal_system().
Referenced by mom_remapping::build_reconstructions_1d(), and regrid_interp::regridding_set_ppolys().
|
private |
A minimum fraction for min(h)/sum(h)
Definition at line 33 of file regrid_edge_values.F90.
Referenced by edge_values_explicit_h4(), edge_values_implicit_h4(), and edge_values_implicit_h6().
|
private |
The default value for cut-off minimum thickness for sum(h) in other calculations.
Definition at line 31 of file regrid_edge_values.F90.
Referenced by bound_edge_values().
|
private |
The default value for cut-off minimum thickness for sum(h) in edge value inversions.
Definition at line 29 of file regrid_edge_values.F90.
Referenced by edge_values_explicit_h2(), edge_values_explicit_h4(), edge_values_implicit_h4(), and edge_values_implicit_h6().