To set the various parameters, the solver settings and the initial and boundary conditions needed, we create a new file called ADR_conditions.xml, which can be found within the resources provided for this tutorial. This new file contains the CONDITIONS tag where we can specify the parameters of the simulations, the solver settings, the initial conditions, the boundary conditions and the exact solution and contains the EXPANSIONS tag where we can specify the polynomial order to be used inside each element of the mesh, the type of expansion bases and the type of points.
We begin to describe the ADR_conditions.xml file from the CONDITIONS tag, and in particular from the boundary conditions, initial conditions and exact solution sections:
In the above piece of .xml, we first need to specify the non-optional tag called VARIABLES that sets the solution variable (in this case u).
The second tag that needs to be specified is BOUNDARYREGIONS through which the user can specify the regions where to apply the boundary conditions. For instance, <B ID="0"> C[100] </B> indicates that composite 100 (which has been introduced in section 1.3) has a boundary ID equal to 0. This boundary ID is successively used to prescribe the boundary conditions.
The third tag is BOUNDARYCONDITIONS by which the boundary conditions are actually specified for each boundary ID specified in the BOUNDARYREGIONS tag. The syntax <D VAR="u" corresponds to a Dirichlet boundary condition for the variable u (note that in this case we used the additional tag USERDEFINEDTYPE="TimeDependent" which is a special option when using time-dependent boundary conditions), while <P VAR="u" corresponds to Periodic boundary conditions. For additional details on the various options possible in terms of boundary conditions refer to the User-Guide.
Finally, <FUNCTION NAME="InitialConditions"> allows the specification of the initial conditions, <FUNCTION NAME="AdvectionVelocity"> specifies the advection velocities in both the x- and y-direction (for this two-dimensional case) and is a non-optional parameters for the unsteady advection equation and <FUNCTION NAME="ExactSolution"> permits us to provide the exact solution, against which the L2 and L∞ errors are computed.
After having configured the VARIABLES tag, the initial and boundary conditions, the advection velocity and the exact solution we can complete the tag CONDITIONS prescribing the parameters necessary (PARAMETERS)and the solver settings (SOLVERINFO):
In the PARAMETERS tag, FinTime is the final physical time of the simulation, TimeStep is the time-step, NumSteps is the number of steps, IO_CheckSteps is the step-interval when a output file is written, IO_InfoSteps is the step-interval when some information about the simulation are printed to the screen, advx and advy are the advection velocities Vx and Vy, respectively and k is the κ parameter. Note that advx, advy and k are used in the boundary and initial conditions tags as well as in the specification of the advection velocities.
In the SOLVERINFO tag, EQTYPE is the type of equation to be solved, Projection is the spatial projection operator to be used (which in this case is specified to be ‘DisContinuous’), AdvectionType is the advection operator to be adopted (where the VALUE ‘WeakDG’ implies the use of a weak Discontinuous Galerkin technique), UpwindType is the numerical flux to be used at the element interfaces when a discontinuous projection is used, TimeIntegrationMethod allows selecting the time-integration scheme. For additional solver-setting options refer to the User-Guide.
Finally, we need to specify the expansion bases we want to use in each of the three composites or sub-domains (COMPOSITE="..") introduced in section 1.3:
In particular, for all the composites, COMPOSITE="C[i]" with i=1,2,3 we select identical basis functions and polynomial order, where NUMMODES is the number of coefficients we want to use for the basis functions (that is commonly equal to P+1 where P is the polynomial order of the basis functions), TYPE allows selecting the basis functions FIELDS is the solution variable of our problem and COMPOSITE are the mesh regions created by Gmsh. For additional details on the EXPANSIONS tag refer to the User-Guide.