! Hartmann problems using periodic BCs. ! The mesh is really coarse in x-direction and we utilize periodic BCs to get the correct profile. ! Iteration converges only with enough relaxation. ! ! This case was based on forum discussion initiated by Andrea_P and and adopted for periodic BCs. ! We use constant pressure drop, so Ha can be defined only after simulation. !$ Ha=? 500 ! This needs to be pretty small to converge with small values. $ relax=0.1 $ visc = 3.925e-4 $ Bext=0.1 $ dp=1.0 Header CHECK KEYWORDS Warn Mesh DB "." "beam" Include Path "" Results Directory "" End Simulation Max Output Level = 5 Coordinate System = Cartesian Coordinate Mapping(3) = 1 2 3 Simulation Type = Steady state Steady State Max Iterations = 100 Output Intervals = 0 Solver Input File = ycase.sif Post File = case.vtu End !Constants !End Body 1 Target Bodies(1) = 1 Name = "Body 1" Equation = 1 Material = 1 Body Force = 1 Initial condition = 1 End Solver 2 Equation = Navier-Stokes Variable = Flow Solution[Velocity:2 Pressure:1] Procedure = "FlowSolve" "FlowSolver" Stabilize = True Optimize Bandwidth = True Steady State Convergence Tolerance = 1.0e-5 ! Enables to use pressure offset in periodic BCs gradp discretization = Logical True Nonlinear System Convergence Tolerance = 1.0e-4 Nonlinear System Max Iterations = 1 Nonlinear System Newton After Iterations = 3 Nonlinear System Newton After Tolerance = 0.0 Nonlinear System Relaxation Factor = $relax Linear System Solver = Iterative Linear System Iterative Method = BiCGStabL Linear System Max Iterations = 2000 ! 1000 Linear System Convergence Tolerance = 1.0e-5 Linear System Preconditioning = ILU2 Linear System Residual Output = 10 Linear System Solver = direct Linear System Direct Method = umfpack End Solver 1 Equation = "Magnetic field solver" Variable = Magnetic Field Procedure = "MagneticSolve" "MagneticSolver" ! Exec Solver = Never Variable DOFs = 3 Exported Variable 1 = -dofs 3 lorentz force Optimize Bandwidth = True Steady State Convergence Tolerance = 1.0e-5 Nonlinear System Convergence Tolerance = 1.0e-4 Nonlinear System Max Iterations = 1 Nonlinear System Relaxation Factor = $relax Linear System Solver = Iterative Linear System Iterative Method = BiCGStabL Linear System Max Iterations = 2000 Linear System Convergence Tolerance = 1.0e-4 Linear System Preconditioning = ILU0 Linear System Abort Not Converged = False Linear System Residual Output = 1 Linear System Precondition Recompute = 1 Linear System Solver = direct Linear System Direct Method = umfpack End Solver 3 Equation = SaveLIne Exec Solver = after saving Procedure = "SaveData" "SaveLine" Filename = f.dat End Equation 1 Name = "Equation 1" Active Solvers(2) = 1 2 End Body Force 1 Lorentz Force = Logical True End Material 1 Name = "ViscousFluid" Viscosity = $visc Density = 9926 Magnetic Permeability = 1e-6 Electric Conductivity = 8000 Applied Magnetic Field 2 = Real $Bext !$ Ha/(0.015*sqrt(8000/visc)) End Initial Condition 1 Name = "InitialCondition 1" Velocity 2 = 0 Velocity 1 = 0 End Boundary Condition 1 Target Boundaries(2) = 1 3 Name = "walls" Noslip Wall BC = True Magnetic Field 1 = Real 0 Magnetic Field 2 = Real 0 Magnetic Field 3 = Real 0 End Boundary Condition 2 Target Boundaries(1) = 4 Name = "inlet" ! When we use periodic BCs we do not need to guess the velocity profile. ! However, a pressure offset is needed to initiate some flow. Periodic BC = 3 Periodic BC Velocity 1 = Logical True Periodic BC Pressure = Logical True Periodic BC Offset Pressure = Real $dp ! Velocity 1 = Variable "Coordinate 2" ! Real MATC "1.5*0.0015*tx*(0.03-tx)/(0.015^2)" ! Velocity 1 = 0.0015 Velocity 2 = 0.0 ! Periodic BC Magnetic Field 1 = Logical True ! Periodic BC Magnetic Field 2 = Logical True ! Periodic BC Magnetic Field 3 = Logical True End Boundary Condition 3 Target Boundaries(1) = 2 Name = "outlet" Velocity 2 = 0 Save Line = True End