Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/fem/tests/BlockDomainsFourHeaters/case.sif
5271 views
! Solver a system with block preconditioner such that different
! physical domains corresponds to different blocks in matrix.
!
! P.R. 9.5.2019

Check Keywords warn

! Heating in different blocks
$h1=1.0  
$h2=2.0  
$h3=3.0  
$h4=4.0  

Header
  Mesh DB "." "spots"
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Simulation Type = Transient
  Timestep Intervals = 1
  Timestep Sizes = 1.0
  Timestepping Method = implicit euler
  Steady State Max Iterations = 1
  Output Intervals = 1

  Post File = "case.vtu"

  Mesh Levels = 3
End

Constants
  Stefan Boltzmann = 1.0
End

Body 1
  Name = "Body1"
  Equation = 1
  Material = 1
End

Body 2
  Name = "Body2"
  Body Force = 1
  Equation = 1
  Material = 1
End

Body 3
  Name = "Body3"
  Body Force = 2
  Equation = 1
  Material = 1
End

Body 4
  Name = "Body4"
  Body Force = 3
  Equation = 1
  Material = 1
End

Body 5
  Name = "Body5"
  Body Force = 4
  Equation = 1
  Material = 1
End

Equation 1
  Name = "Equation"
  Active Solvers = 1
End

Material 1
  Name = "Unity"
  Density = 1.0
  Heat Conductivity = 1.0
  Heat Capacity = 1.0
End

Body Force 1
  Name = "Heater1"
  Heat Source = $h1  

! Just for the fun of it we create two additional block matrices
! The block matrix "1" will be the rest.
  Block Index = Integer 2
End

Body Force 2
  Name = "Heater2"
  Heat Source = $h2
  Block Index = Integer 2 
End

Body Force 3
  Name = "Heater3"
  Heat Source = $h3
  Block Index = Integer 3 
End

Body Force 4
  Name = "Heater4"
  Heat Source = $h4
  Block Index = Integer 3 
End


Solver 1
  Equation = Heat Equation
  Procedure = "HeatSolve" "HeatSolver"
  Variable = Temperature

  Steady State Convergence Tolerance = 1.0e-05
  Nonlinear System Max Iterations = 1
  Nonlinear System Relaxation Factor = 1.0

! These choose the overall block strategies
!-----------------------------------------
  Linear System Block Mode = Logical True
  Block Preconditioner = Logical True
  Block Gauss-Seidel = Logical True
  Block Matrix Reuse = Logical True
  Block Domain System = Logical True

! Linear system solver for outer loop
!-----------------------------------------
  Outer: Linear System Solver = string "Iterative"
  Outer: Linear System Convergence Tolerance = real 1e-10
  Outer: Linear System Iterative Method = string GCR
  Outer: Linear System GCR Restart = Integer 100
  Outer: Linear System Residual Output = integer 1
  Outer: Linear System Max Iterations = integer 100

! Linear system solver for blocks
!-----------------------------------------
  Block 11: Linear System Solver = Iterative
  Block 11: Linear System Iterative Method = BiCGStab
  Block 11: Linear System Max Iterations = 500
  Block 11: Linear System Convergence Tolerance = 1.0e-06
  Block 11: Linear System Preconditioning = none !ILU0
  Block 11: Linear System Residual Output = 20

  Block 22: Linear System Solver = direct
  Block 22: Linear System Direct Method = umfpack

  Block 33: Linear System Solver = direct
  Block 33: Linear System Direct Method = umfpack

  Block 44: Linear System Solver = direct
  Block 44: Linear System Direct Method = umfpack

  Block 55: Linear System Solver = direct
  Block 55: Linear System Direct Method = umfpack
End


Solver 2
  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"
  Filename = f.dat

  Variable 1 = Temperature
  Operator 1 = max

  Show Norm Index = 1
End 
  


Boundary Condition 1
  Name = "Sides"
  Target Boundaries = 1
  Temperature = Real 0
End


Solver 2 :: Reference Norm = 1.76496705E+00