read_flow Subroutine

private subroutine read_flow(files, control, flow)

Read flow.md control file

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files
type(controltype), intent(inout) :: control
type(flowtype), intent(inout) :: flow

Calls

proc~~read_flow~~CallsGraph proc~read_flow read_flow debuginfo debuginfo proc~read_flow->debuginfo debugcall debugcall proc~read_flow->debugcall proc~get_next_token get_next_token proc~read_flow->proc~get_next_token

Called by

proc~~read_flow~~CalledByGraph proc~read_flow read_flow proc~read_input_and_controls read_input_and_controls proc~read_input_and_controls->proc~read_flow proc~setup_solver setup_solver proc~setup_solver->proc~read_input_and_controls proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

      subroutine read_flow(files, control, flow)
        !< Read flow.md control file
        !--------------------------------------------
        implicit none
        type(filetype), intent(in) :: files
        type(controltype), intent(inout) :: control
        type(flowtype), intent(inout) :: flow

        character(len=STRING_BUFFER_LENGTH) :: buf

        DebugCall('read_flow')

        open(files%FLOW_FILE_UNIT, file=files%flow_file, status='old', action='read')

        ! ignoring file header
        read(files%FLOW_FILE_UNIT,*)
        read(files%FLOW_FILE_UNIT,*)
        read(files%FLOW_FILE_UNIT,*)
       
        ! read number of variable
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) control%n_var
        DebugInfo('Number of variables = '//trim(buf))

        ! read rho_inf
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%density_inf
        DebugInfo('free_stream_density = '//trim(buf))

        ! read u_inf
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%x_speed_inf
        DebugInfo('free_stream_x_speed = '//trim(buf))

        ! read v_inf
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%y_speed_inf
        DebugInfo('free_stream_y_speed = '//trim(buf))

        ! read w_inf
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%z_speed_inf
        DebugInfo('free_stream_z_speed = '//trim(buf))

        ! read P_inf
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%pressure_inf
        DebugInfo('free_stream_pressure = '//trim(buf))

        ! read turbulence intensity in percentage
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%tu_inf
        DebugInfo('free_stream_Turb_intensity = '//trim(buf))

        ! read viscosity ratio
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%mu_ratio_inf
        DebugInfo('free_stream_mu_ratio = '//trim(buf))

        ! read intermittency
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%tgm_inf
        DebugInfo('free_stream_Intermittency = '//trim(buf))

        ! read reference viscosity
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%mu_ref
        DebugInfo('mu_reference = '//trim(buf))

        ! Type of variation for viscosity
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%mu_variation
        DebugInfo('mu_variation = '//trim(buf))

        ! read T_red
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%T_ref
        DebugInfo('T_reference = '//trim(buf))

        ! read Sutherland temp
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%Sutherland_temp
        DebugInfo('Sutherland temperature = '//trim(buf))

        ! read prandtl number
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%Pr, flow%tPr
        DebugInfo('Prandtl Number = '//trim(buf))

        ! read gamma
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%gm
        DebugInfo('gamma = '//trim(buf))

        ! read universal gas constant
        call get_next_token(files%FLOW_FILE_UNIT, buf)
        read(buf, *) flow%R_gas
        DebugInfo('R_gas = '//trim(buf))
          

        close(files%FLOW_FILE_UNIT)

      end subroutine read_flow