Advection-Reaction Equation (Discontinuous Galerkin) Problem

Numerical methods and mathematical models of Elmer
Post Reply
wesl
Posts: 3
Joined: 31 Oct 2012, 15:33
Antispam: Yes

Advection-Reaction Equation (Discontinuous Galerkin) Problem

Post by wesl »

Hi,

I'm having an issue with a simple 1D Advection-Reaction Equation using discontinuous Galerkin. I have one variable that I call density, and when I try to set an initial condition it looks like half the domain does not get values. When I look at the solution for the nodaly interpolated "density" this is what I see:

Code: Select all

#time       1      1  1.00000000E-002
 -3.88888889E+000
  6.88888889E-001
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  1.00000000E+000
  2.01250000E+000
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
  1.66500123E-321
The second half of the domain has values of 1.665E-321. This occurs when setting a MATC function or just a uniform value for the initial condition.

If anyone has any ideas it would be greatly appreciated.

Attached are my geometry and input files.

Thanks,
Wes

line.grd
1D Geometry File
(499 Bytes) Downloaded 305 times
advection_reaction_dg.sif
Input File
(2.02 KiB) Downloaded 318 times



UPDATE:
I suspect this issue is in the mesh creation. I am using the command:

Code: Select all

ElmerGrid 1 2 line.grd -halo
I'm not sure if the '-halo' is doing anything?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Advection-Reaction Equation (Discontinuous Galerkin) Problem

Post by raback »

Hi

Don't know whether DG works in 1D. Perhaps somebody else has a clue on that. What I do know is that the -halo flag is only related to the partitioning where DG requires halo elements whereas most other elements do not. In serial cases it has no effect.

-Peter
wesl
Posts: 3
Joined: 31 Oct 2012, 15:33
Antispam: Yes

Re: Advection-Reaction Equation (Discontinuous Galerkin) Problem

Post by wesl »

Thanks, I'll do a similar test with a pseudo-1D problem in a 2D domain to see if a similar problem arises.

Wes
wesl
Posts: 3
Joined: 31 Oct 2012, 15:33
Antispam: Yes

Re: Advection-Reaction Equation (Discontinuous Galerkin) Problem

Post by wesl »

Also, do people know if periodic BCs work with a DG discretization?
tzwinger
Site Admin
Posts: 100
Joined: 24 Aug 2009, 12:20
Antispam: Yes

Re: Advection-Reaction Equation (Discontinuous Galerkin) Problem

Post by tzwinger »

Hello,
do not know about periodic BC's. A good idea would be to replace Variable name Density to something else, as Density is a reserved name for the material property. The following file produces something - not sure what, though:

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "line"
  Include Path ""
  Results Directory ""
End

Simulation
  Simulation Type = Transient
  Coordinate System = Cartesian 1D
  Coordinate Mapping(3) = 1 2 3
  Timestepping Method = BDF
  BDF Order = 2

  Max Output Level = 5
  Steady State Max Iterations = 10
  Steady State Min Iterations = 2
  Output Intervals = 1
  Timestep Intervals = 10
  Timestep Sizes = 1e-2
  Solver Input File = advection_reaction_dg.sif
  Post File = advection_reaction_dg.ep
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Material = 1
  Body Force = 1
  Equation = 1
  Initial Condition = 1
End

Solver 1
  Equation = "Advection-Reaction Equation Density"
  Procedure = File "AdvectionReaction" "AdvectionReactionSolver"
  Variable = -nooutput "OtherName"
  Exported Variable 1 = "OtherName Nodal"
  Exported Variable 1 DOFS = 1
  Discontinuous Galerkin = Logical TRUE
  !Limit Solution = Logical TRUE

  Steady State Convergence Tolerance = 1.0e-6
 
  Linear System Solver = Direct
  Linear System Direct Method = UMFPACK
  Linear System Convergence Tolerance = 1.0e-06
!  Linear System Solver = Iterative
!  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations  = 1000	
  Linear System Preconditioning = ILU1
  Linear System Residual Output = 1

  Nonlinear System Max Iterations = 1
  Nonlinear System Convergence Tolerance = 1.0e-5
End

Equation 1
  Name = "Advection-Reaction"
  Advection-Reaction Equation OtherName = Logical TRUE
  Convection = Constant
  Active Solvers(1) = 1
End

Body Force 1
  OtherName Source = Real 0.0
End

Initial Condition 1
  Othername = Variable Coordinate
    Real MATC "exp(-((tx-0.5)^2)/0.20^2)"
  !OtherName = Real 1.0
End

Material 1
  Convection Velocity 1 = 1.0
!  OtherName Upper Limit = Real 100000
!  OtherName Lower Limit = Real 0
  OtherName Gamma = Real 0.0
  Density = 1.0
End

Boundary Condition 1
  Name = "Inflow"
  Target Boundaries = 1
   OtherName = Real 0.0
!  Periodic BC = 2
!  Periodic BC OtherName = Logical TRUE
End

Boundary Condition 2
  Name = "Outflow"
 Target Boundaries = 2
End
Post Reply