Prepares data for run.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(cdifs_obj), | intent(inout) | :: | this |
CDIFS solver |
module subroutine cdifs_obj_PrepareSolver(this) !> Prepares data for run. implicit none class(cdifs_obj), intent(inout) :: this !! CDIFS solver ! Work variables real(wp) :: ds logical :: use_IB_col ! Set solver parameters call this%parser%Get("Fluid density", this%rho ) call this%parser%Get("Fluid viscosity", this%visc ) call this%parser%Get("Gravity", this%gravity, default = & [0.0_wp, 0.0_wp, 0.0_wp]) call this%parser%Get("Subiterations", this%subit, default = 2 ) call this%parser%Get('Use ResPart', this%use_RP, default = .false. ) call this%parser%Get('Use IB', this%use_IB, default = .false. ) call this%parser%Get('Use collisions', this%use_col, default = .false. ) call cdifs_obj_PrepareSolverBlock(this) call cdifs_obj_PrepareSolverFields(this) call cdifs_obj_PrepareSolverBCS(this) call cdifs_obj_PrepareSolverOperators(this) call cdifs_obj_PrepareSolverBodyforce(this) ! Activate other components ! - Initialize Resolved Particles if (this%use_RP) then call this%RP%Initialize('ResPart',this%block,this%parallel) call this%RP%Prepare(this%timer,this%parser,this%op,this%bcs,this%monitors,update_time=.false.) end if ! - Initialize Immersed Boundaries if (this%use_IB) then call this%IB%Initialize('IB', this%block,this%parallel) call this%IB%Prepare(this%timer,this%parser,this%op,this%bcs,this%monitors,update_time=.false.) end if ! - Compute initial surface density function and solid volume fraction if ( this%use_RP .or. this%use_IB) then ! Update SDF this%ibS = 0.0_wp if (this%use_RP) call this%RP%UpdateSDF(this%ibS) if (this%use_IB) call this%IB%UpdateSDF(this%ibS) call this%bcs%UpdateBoundary(this%ibS) ! Update the solid volume fraction call this%ComputeSolidVF() end if ! - Initialize collision utilities if (this%use_col) then call this%parser%Get('Collision grid spacing', ds ) call this%parser%Get('Collision substeps', this%maxitp, default = 8 ) call this%parser%Get('Collision with IB', use_IB_col, default = .true.) ! Prepare structure call this%collisions%Initialize(this%parallel) call this%collisions%Prepare(this%timer,this%parser,this%monitors) if (this%use_RP) call this%collisions%Add(this%RP) if (this%use_IB.and.use_IB_col) & call this%collisions%Add(this%IB) call this%collisions%SetupCollisionBlock(ds,1) end if ! I/O utilities call cdifs_obj_PrepareSolverMonitor(this) call cdifs_obj_PrepareSolverOutput(this) ! Monitor and output initial conditions call this%WriteOutputData() call this%Monitor() return end subroutine cdifs_obj_PrepareSolver