Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/fem/tests/AdvReactDGZoltan/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 = 20
 
  Coordinate System = "Cartesian"
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady
  Steady State Max Iterations = 1
  Output Intervals = 1

!  Post File = "DGsolution.vtu"
!  vtu: Discontinuous Galerkin = Logical True

! These are the internal partitioning commands
  Partition Mesh = Logical True
  Partitioning Method = String "Zoltan"
  Number of partitions = Integer 6
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 "AdvectionReaction" "AdvectionReactionSolver"
  Variable = "Potential"
  Exported Variable 1 = "Nodal Result"
  Discontinuous Galerkin = True

!  Discontinuous bodies = True
  Optimize Bandwidth = False
  
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations  = 1000
  Linear System Preconditioning = ILU0
  Linear System Convergence Tolerance = 1.0e-6

  Nonlinear System Min Iterations = 1
  Nonlinear System Max Iterations = 1
  Nonlinear System Consistent Norm = True
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 = 1.41415223
Solver 1 :: Reference Norm Tolerance = 1.0e-3