-
Notifications
You must be signed in to change notification settings - Fork 117
Setting up a run using a P1DG P2 discretization
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.
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
choosemesh(CoordinateMesh)
, enablemesh_continuity
and set it todiscontinuous
.
PressureMesh
-
from_mesh
choosemesh(CoordinateMesh)
, enablemesh_shape
and setpolynomial_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.
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.
Select discontinuous_galerkin
under spatial_discretisation
. The default values of viscosity_scheme
and advection_scheme
are probably what you want.
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
.
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.
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.
Select the PressureMesh that you created.
Select continuous_galerkin
under spatial_discretisation
.
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.