Skip to content

Setting up a run using a P1DG P2 discretization

James Percival edited this page Jun 17, 2014 · 3 revisions

For particular problems you may wish to use a P1DGP2 discretisation.

This has polynomial order one discontinuous Galerkin velocity (DG) and polynomial order two pressure (P2). Temperature/Salinity are usually of order one, but can be continuous or discontinuous Galerkin.

Overview

Mesh configuration

Generally speaking, you will have a P1 continuous CoordinateMesh. You then derive the quadratic PressureMesh and the discontinuous VelocityMesh from this as follows:

CoordinateMesh

  • from_file and specify the correct triangle file name.

VelocityMesh

  • from_mesh choose mesh(CoordinateMesh), enable mesh_continuity and set it to discontinuous.

PressureMesh

  • from_mesh choose mesh(CoordinateMesh), enable mesh_shape and set polynomial_degree to 2.

If you have a periodic domain then you should derive your PeriodicMesh from CoordinateMesh and then derive VelocityMesh and PressureMesh as above but from the PeriodicMesh rather than CoordinateMesh.

Pressure discretisation

Select continuous_galerkin under spatial_discretisation.

The remove_stabilisation_term is ignored by the DG code path (because P1DG-P2 is stable anyway). Similarly, integrate_continuity_by_parts will be ignored.

Under scheme, set poisson_pressure_scheme to never.

Velocity discretisation

Select discontinuous_galerkin under spatial_discretisation. The default values of viscosity_scheme and advection_scheme are probably what you want.

Tracer discretisation

Select discontinuous_galerkin under spatial_discretisation. The default values of viscosity_scheme and advection_scheme are probably what you want.

You may wish to experiment with enabling slope_limiter under discontinuous_galerkin.

Detailed Instructions

Creating the meshes

The CoordinateMesh is usually uploaded from a GMSH or triangle file:

Alternatively, if you wish to use a 3d extruded mesh you may wish to extrude within fluidity. In that case you must read in a 2d mesh and use this to create a 3d extruded CoordinateMesh as shown below.

The VelocityMesh is created from the CoordinateMesh. The mesh_continuity option is changed to discontinuous_galerkin.

The PressureMesh is also created from the CoordinateMesh. The mesh_shape/polynomial_order option is set to 2.

The quadrature degree is usually set to max(2deg_u +1, 2deg_p), where deg_u is the polynomial order of u and deg_p is the polynomial order of p. In this case, the quadrature is 4.

Velocity options

You must select VelocityMesh so that the velocity is solved on this mesh. Under spatial_discretisation, select discontinuous_galerkin. Under viscosity_scheme, you can use Bassi Rebay, or `compact_discontinuous_galerkin. CDG is recommended.

Under temporal discretisation you do not need to switch on the discontinuous_galerkin option. If you choose to switch it on you can set options relating to the number of subcycles.

Pressure options

Select the PressureMesh that you created.

Select continuous_galerkin under spatial_discretisation.

Temperature/Salinity

If you wish to use continuous Galerkin or control volumes you will need to select the CoordinateMesh. If you wish to use discontinuous Galerkin, then use the VelocityMesh (probably default). Then select your chosen discretisation under spatial_discretisation.

As with velocity, if you are using discontinuous galerkin spatial discretisation you may set the discontinuous galerkin options under temporal discretisation, which allow you to set options relating to subcycling. This is not compulsory.

Clone this wiki locally