Synchronizes namelist parameters with mesh patches to create a complete BC set.
This routine iterates through all patches in the mesh_t structure and
searches for matching names in the case_params_t object. It converts
string-based inputs into internal type IDs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The computational mesh containing patch definitions. |
||
| type(case_params_t), | intent(in) | :: | params |
Parsed case configuration from |
||
| type(bc_set_t), | intent(inout) | :: | bc |
The boundary condition set to be populated. |
subroutine build_bc_set(mesh, params, bc) type(mesh_t), intent(in) :: mesh type(case_params_t), intent(in) :: params type(bc_set_t), intent(inout) :: bc integer :: p, q logical :: found call finalize_bc_set(bc) bc%npatches = mesh%npatches allocate(bc%patches(mesh%npatches)) do p = 1, mesh%npatches bc%patches(p)%patch_id = p bc%patches(p)%name = mesh%patches(p)%name bc%patches(p)%type_name = "wall" bc%patches(p)%type_id = bc_wall found = .false. do q = 1, params%n_patches if (trim(params%patch_name(q)) == trim(mesh%patches(p)%name)) then bc%patches(p)%type_name = trim(lowercase(params%patch_type(q))) bc%patches(p)%type_id = parse_bc_type(params%patch_type(q)) bc%patches(p)%velocity = [params%patch_u(q), params%patch_v(q), params%patch_w(q)] bc%patches(p)%mass_flux = params%patch_mass_flux(q) bc%patches(p)%pressure = params%patch_p(q) bc%patches(p)%dpdn = params%patch_dpdn(q) bc%patches(p)%temperature = params%patch_T(q) if (trim(params%patch_velocity_type(q)) /= "") then bc%patches(p)%velocity_type_id = parse_bc_type(params%patch_velocity_type(q)) else bc%patches(p)%velocity_type_id = parse_bc_type(params%patch_type(q)) end if if (trim(params%patch_pressure_type(q)) /= "") then bc%patches(p)%pressure_type_id = parse_bc_type(params%patch_pressure_type(q)) else bc%patches(p)%pressure_type_id = parse_bc_type(params%patch_type(q)) end if if (trim(params%patch_species_type(q)) /= "") then bc%patches(p)%species_type_id = parse_bc_type(params%patch_species_type(q)) else bc%patches(p)%species_type_id = parse_bc_type(params%patch_type(q)) end if if (composition_string_is_set(params%patch_composition(q))) then call parse_named_composition(params%patch_composition(q), params%species_name, params%nspecies, & bc%patches(p)%species_Y, & 'boundary patch_composition('//trim(params%patch_name(q))//')', & normalize=.true., require_sum_positive=.true.) else bc%patches(p)%species_Y(:) = params%patch_Y(:, q) end if if (trim(params%patch_temperature_type(q)) /= "") then bc%patches(p)%temperature_type_id = parse_bc_type(params%patch_temperature_type(q)) else bc%patches(p)%temperature_type_id = parse_bc_type(params%patch_type(q)) end if found = .true. exit end if end do if (.not. found) then call fatal_error('bc', 'mesh patch '//trim(mesh%patches(p)%name)//' missing from case.nml') end if if (bc%patches(p)%type_id == bc_periodic) then call ensure_periodic_links(mesh, p) end if end do end subroutine build_bc_set