Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/fem/tests/AdvReactDG_P/AdvReactDG.sif
3206 views
Header
  CHECK KEYWORDS Warn
  Mesh DB "." "square"
End

! equation coefficients (g*r+ux*dx+uy*dy=f)
! -----------------------------------------
$ function g(c)   { _g  = 1+8*c(0)*c(1)^2 }
$ function ux(c)  { _ux = 2-(2*c(1)-1)^2  }
$ function uy(c)  { _uy = 3-2*c(0) }

! analytical result and its spatial derivatives:
! ----------------------------------------------
$ function r(c)   { _r  = 1+sin(pi*c(0)*c(1)^2) }
$ function dx(c)  { x=c(0); y=c(1); _dx = pi*y^2*cos(pi*x*y^2) }
$ function dy(c)  { x=c(0); y=c(1); _dy = pi*x*2*y*cos(pi*x*y^2) }

Simulation
  Max Output Level = 5
  Coordinate System = "Cartesian 2D"
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady
  Steady State Max Iterations = 1
  Output Intervals = 1
  Post File = "DGsolution.vtu"
End

Constants
End

Body 1
  Equation   = 1
  Material   = 1
  Body force = 1
End

Equation 1
  Active Solvers(1) = 1
  Convection = constant
End

Material 1
  Convection Velocity 1 = Variable Coordinate
    Real MATC "ux(tx)"

  Convection Velocity 2 = Variable Coordinate
    Real MATC "uy(tx)"

  Potential Gamma = Variable Coordinate
     Real MATC "g(tx)"
End

Solver 1
  Equation = "AdvReact"
  Procedure = File "AdvReactDG_P" "AdvectionReactionSolver"
  Variable = "Potential"
  Exported Variable 1 = "Nodal Result"
  Discontinuous Galerkin = Logical TRUE

  Element =  "p:3 d:12"

  Linear System Solver = Direct
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations  = 1000
  Linear System Preconditioning = ILU0
  Linear System Convergence Tolerance = 1.0e-6
End


Body Force 1
  Potential Source = Variable Coordinate
    Real MATC "r(tx)*g(tx)+ux(tx)*dx(tx)+uy(tx)*dy(tx)"
End

Boundary Condition 1
  Target Boundaries(4) = 1 2 3 4
  Potential = Variable Coordinate
    Real MATC "r(tx)"
End


Solver 1 :: Reference Norm = Real 0.81556055
Solver 1 :: Reference Norm Tolerance = Real 1.0e-3
RUN