ppm_edge_nonuniform Subroutine

private pure subroutine ppm_edge_nonuniform(h0, h1, h2, h3, q1, q2, dq1, dq2, edge)

Colella & Woodward (1984) eq (1.6): the fourth-order interface value between cells 1 and 2 on a NON-UNIFORM stencil h0,h1,h2,h3.

On equal thicknesses the whole correction term collapses and this becomes (7/12)(q1 + q2) - (1/12)(q0 + q3), the shipped estimate. On a stretched column the correction is what makes it consistent: substituting a profile linear in z (so dq1 = a*h1, dq2 = a*h2) the three correction terms cancel IDENTICALLY, leaving q1 + (h1/(h1+h2))*(q2-q1), which is the exact interface value.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: h0

Thickness two cells below the interface.

real(kind=wp), intent(in) :: h1

Thickness of the cell just below the interface.

real(kind=wp), intent(in) :: h2

Thickness of the cell just above the interface.

real(kind=wp), intent(in) :: h3

Thickness two cells above the interface.

real(kind=wp), intent(in) :: q1

Cell mean just below the interface.

real(kind=wp), intent(in) :: q2

Cell mean just above the interface.

real(kind=wp), intent(in) :: dq1

Limited CW84 (1.7) jump of the cell below.

real(kind=wp), intent(in) :: dq2

Limited CW84 (1.7) jump of the cell above.

real(kind=wp), intent(out) :: edge

Interface value.


Called by

proc~~ppm_edge_nonuniform~~CalledByGraph proc~ppm_edge_nonuniform ppm_edge_nonuniform proc~remap_column_ppm remap_column_ppm proc~remap_column_ppm->proc~ppm_edge_nonuniform proc~remap_column remap_column proc~remap_column->proc~remap_column_ppm proc~remap_column_pqm remap_column_pqm proc~remap_column->proc~remap_column_pqm proc~remap_column_pqm->proc~remap_column_ppm proc~ocean_remap_tracer_column ocean_remap_tracer_column proc~ocean_remap_tracer_column->proc~remap_column proc~ocean_remap_tracer_field ocean_remap_tracer_field proc~ocean_remap_tracer_field->proc~remap_column proc~remap_layer_to_density_impl remap_layer_to_density_impl proc~remap_layer_to_density_impl->proc~remap_column proc~remap_layer_to_vcoord_impl remap_layer_to_vcoord_impl proc~remap_layer_to_vcoord_impl->proc~remap_column proc~remap_tracer_grounded remap_tracer_grounded proc~remap_tracer_grounded->proc~remap_column proc~remap_x_face_grounded remap_x_face_grounded proc~remap_x_face_grounded->proc~remap_column proc~remap_x_face_velocity remap_x_face_velocity proc~remap_x_face_velocity->proc~remap_column proc~remap_y_face_grounded remap_y_face_grounded proc~remap_y_face_grounded->proc~remap_column proc~remap_y_face_velocity remap_y_face_velocity proc~remap_y_face_velocity->proc~remap_column proc~ocean_apply_ale_remap_centres ocean_apply_ale_remap_centres proc~ocean_apply_ale_remap_centres->proc~ocean_remap_tracer_field proc~ocean_apply_ale_remap_faces ocean_apply_ale_remap_faces proc~ocean_apply_ale_remap_faces->proc~remap_x_face_velocity proc~ocean_apply_ale_remap_faces->proc~remap_y_face_velocity proc~ocean_apply_ale_remap_step ocean_apply_ale_remap_step proc~ocean_apply_ale_remap_step->proc~ocean_remap_tracer_field proc~ocean_apply_ale_remap_step->proc~remap_x_face_velocity proc~ocean_apply_ale_remap_step->proc~remap_y_face_velocity proc~ocean_apply_conservative_min_thickness ocean_apply_conservative_min_thickness proc~ocean_apply_conservative_min_thickness->proc~remap_tracer_grounded proc~ocean_apply_conservative_min_thickness->proc~remap_x_face_grounded proc~ocean_apply_conservative_min_thickness->proc~remap_y_face_grounded proc~remap_layer_to_density remap_layer_to_density proc~remap_layer_to_density->proc~remap_layer_to_density_impl proc~remap_layer_to_sigma remap_layer_to_sigma proc~remap_layer_to_sigma->proc~remap_layer_to_vcoord_impl proc~remap_layer_to_z remap_layer_to_z proc~remap_layer_to_z->proc~remap_layer_to_vcoord_impl proc~remap_layer_to_zstar remap_layer_to_zstar proc~remap_layer_to_zstar->proc~remap_layer_to_vcoord_impl proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~ocean_apply_ale_remap_step proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~ocean_apply_conservative_min_thickness

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: dq21
real(kind=wp), private :: i_h12
real(kind=wp), private :: wa
real(kind=wp), private :: wb

Source Code

   pure subroutine ppm_edge_nonuniform(h0, h1, h2, h3, q1, q2, dq1, dq2, edge)
      !$acc routine seq
      !! Colella & Woodward (1984) eq (1.6): the fourth-order interface value
      !! between cells 1 and 2 on a NON-UNIFORM stencil `h0,h1,h2,h3`.
      !!
      !! On equal thicknesses the whole correction term collapses and this
      !! becomes `(7/12)(q1 + q2) - (1/12)(q0 + q3)`, the shipped estimate.
      !! On a stretched column the correction is what makes it consistent:
      !! substituting a profile linear in `z` (so `dq1 = a*h1`, `dq2 = a*h2`)
      !! the three correction terms cancel IDENTICALLY, leaving
      !! `q1 + (h1/(h1+h2))*(q2-q1)`, which is the exact interface value.
      real(wp), intent(in) :: h0
         !! Thickness two cells below the interface.
      real(wp), intent(in) :: h1
         !! Thickness of the cell just below the interface.
      real(wp), intent(in) :: h2
         !! Thickness of the cell just above the interface.
      real(wp), intent(in) :: h3
         !! Thickness two cells above the interface.
      real(wp), intent(in) :: q1
         !! Cell mean just below the interface.
      real(wp), intent(in) :: q2
         !! Cell mean just above the interface.
      real(wp), intent(in) :: dq1
         !! Limited CW84 (1.7) jump of the cell below.
      real(wp), intent(in) :: dq2
         !! Limited CW84 (1.7) jump of the cell above.
      real(wp), intent(out) :: edge
         !! Interface value.

      real(wp) :: dq21, wa, wb, i_h12

      dq21 = q2 - q1
      i_h12 = 1.0_wp/(h1 + h2 + H_DIV_EPS)
      wa = (h0 + h1)/(2.0_wp*h1 + h2 + H_DIV_EPS)
      wb = (h2 + h3)/(h1 + 2.0_wp*h2 + H_DIV_EPS)
      edge = q1 + h1*i_h12*dq21 &
             + (2.0_wp*h1*h2*i_h12*(wa - wb)*dq21 - h1*wa*dq2 + h2*wb*dq1) &
             /(h0 + h1 + h2 + h3 + H_DIV_EPS)
   end subroutine ppm_edge_nonuniform