version = 4.2

//
// Saved by sw version: 2024.1
//

model "thcc_model" {
    configuration {
        hil_device = "HIL606"
        hil_configuration_id = 1
        simulation_method = exact
        simulation_time_step = 5e-6
        simulation_discret_scaling = 1.0
        dsp_timer_periods = 100e-6, 50e-3
        ss_calc_method = "systematic elimination"
        enb_pole_shift = True
        enb_gds_oversampling = True
        show_modes = False
        device_ao_limit_enable = False
        reset_analog_outputs_on_sim_stop = True
        reset_analog_outputs_on_sim_stop_mode = Offset values
        reset_digital_outputs_on_sim_stop = True
        vhil_adio_loopback = False
        cpl_stb = False
        enb_dep_sw_detect = False
        code_section = "internal memory"
        data_section = "internal memory"
        sys_sp_rate_1 = 0.0001
        sys_sp_rate_2 = 0.05
        sys_real_type_precision = "default"
        user_real_type_precision = "default"
        sys_cpu_optimization = "high"
        user_cpu_optimization = "high"
        user_cpu_part_option = "default"
        matrix_based_reduction = True
        cpl_dynamics_analysis = False
        export_ss_to_pickle = False
        ground_scope_core = False
        dss_num_tol = 1e-15
        cce_platform = "generic"
        cce_use_relative_names = False
        cce_type_mapping_real = "double"
        cce_type_mapping_uint = "unsigned int"
        cce_type_mapping_int = "int"
        cce_platform = "generic"
        cce_use_relative_names = False
        cce_type_mapping_real = "double"
        cce_type_mapping_uint = "unsigned int"
        cce_type_mapping_int = "int"
        cce_directory = ""
        cce_custom_type_int = ""
        cce_custom_type_uint = ""
        cce_custom_type_real = ""
        tunable_params = "component defined"
        sp_compiler_type = "C compiler"
        sig_stim = "off"
        export_resource_list = ""
        export_dependency_list = ""
        excluded_resource_list = ""
        export_out_file = ""
        export_lock_top_level = True
        export_encrypt_library = True
        export_encrypt_resources = True
        dae_solver = "BDF"
        max_sim_step = 1e-4
        simulation_time = 1.0
        abs_tol = 1e-3
        rel_tol = 1e-3
        init_sim_step = 1e-6
        r_on_sw = 1e-3
        v_on_diode = 0.2
        data_sampling_rate = 0
        feedthrough_validation_error_level = error
    }

    component Subsystem Root {
        component "core/Grid Simulator" "Grid Simulator1" {
            Vb = "7.35e5"
            f = "60"
            inductance_grid_simulator = "16.58e-3"
            resistance_grid_simulator = "0.8929"
        }
        [
            position = 8232, 8240
            scale = -1, 1
            size = 120, 256
        ]

        component "core/Three Phase Two Winding Transformer" Tr1 {
            L1 = "0.45856"
            L2 = "0.084225"
            Lm = "2886"
            R1 = "4.3218"
            R2 = "0.7938"
            Rm = "1.0804e+06"
            V1 = "7.35e5"
            V2 = "3.15e5"
            input = "SI"
        }
        [
            position = 8648, 8240
            size = 126, 256
        ]

        component "core/Constant Impedance Load" "Constant Impedance Load1" {
            SAB = "175000000.0/3"
            SAn = "175e6/3"
            SBC = "175000000.0/3"
            SBn = "175e6/3"
            SCA = "175000000.0/3"
            SCn = "175e6/3"
            Sn_3ph = "175e6"
            VAB = "315000.0"
            VAn = "3.15e5/np.sqrt(3)"
            VBC = "315000.0"
            VBn = "3.15e5/np.sqrt(3)"
            VCA = "315000.0"
            VCn = "3.15e5/np.sqrt(3)"
            Vn_3ph = "3.15e5"
            enable_neutral = "True"
        }
        [
            position = 9128, 8248
            rotation = left
            size = 184, 152
        ]

        component "core/Current Measurement" Ia1 {
        }
        [
            position = 8816, 8176
            size = 64, 32
        ]

        component "core/Dynamic Grid Fault" "Dynamic Grid Fault1" {
            Rph_ph = "0.001"
            ctrl_method = "Signal input"
        }
        [
            position = 8936, 8232
            size = 64, 64
        ]

        component "core/Step" Step1 {
            final_value = "5"
            step_time = "0.05"
        }
        [
            position = 8760, 8016
        ]

        component "core/Grid Simulator" "Grid Simulator2" {
            Vb = "7.35e5"
            f = "60"
            inductance_grid_simulator = "16.58e-3"
            resistance_grid_simulator = "0.8929"
        }
        [
            position = 8232, 8888
            scale = -1, 1
            size = 120, 256
        ]

        component "core/Constant Impedance Load" "Constant Impedance Load2" {
            SAB = "175000000.0/3"
            SAn = "175e6/3"
            SBC = "175000000.0/3"
            SBn = "175e6/3"
            SCA = "175000000.0/3"
            SCn = "175e6/3"
            Sn_3ph = "175e6"
            VAB = "315000.0"
            VAn = "3.15e5/np.sqrt(3)"
            VBC = "315000.0"
            VBn = "3.15e5/np.sqrt(3)"
            VCA = "315000.0"
            VCn = "3.15e5/np.sqrt(3)"
            Vn_3ph = "3.15e5"
            enable_neutral = "True"
        }
        [
            position = 9128, 8888
            rotation = left
            size = 184, 152
        ]

        component "core/Current Measurement" Ia2 {
        }
        [
            position = 8816, 8816
            size = 64, 32
        ]

        component "core/Dynamic Grid Fault" "Dynamic Grid Fault2" {
            Rph_ph = "0.001"
            ctrl_method = "Signal input"
        }
        [
            position = 8936, 8888
            size = 64, 64
        ]

        component "core/Step" Step2 {
            final_value = "5"
            step_time = "0.05"
        }
        [
            position = 8760, 8656
        ]

        component Subsystem "Three-limb core (core-type) transformer" {
            layout = dynamic

            port P3 {
                position = left:3
                kind = pe
                direction =  in
            }
            [
                position = 7728, 8288
            ]

            port P2 {
                position = left:2
                kind = pe
                direction =  in
            }
            [
                position = 7728, 8192
            ]

            port P5 {
                position = bottom:2
                kind = pe
                direction =  in
            }
            [
                position = 8224, 8560
                rotation = left
            ]

            port P6 {
                position = right:1
                kind = pe
            }
            [
                position = 8640, 8088
                rotation = down
            ]

            port P4 {
                position = bottom:1
                kind = pe
                direction =  in
            }
            [
                position = 8160, 8560
                rotation = left
            ]

            port P1 {
                position = left:1
                kind = pe
            }
            [
                position = 7728, 8096
            ]

            port P7 {
                position = right:2
                kind = pe
                direction =  in
            }
            [
                position = 8640, 8184
                rotation = down
            ]

            port P8 {
                position = right:3
                kind = pe
                direction =  in
            }
            [
                position = 8640, 8280
                rotation = down
            ]
        }
        [
            position = 8608, 8888
            size = 120, 232
        ]

        junction Junction1 pe
        [
            position = 8936, 8512
        ]

        junction Junction2 pe
        [
            position = 8688, 8512
        ]

        junction Junction3 pe
        [
            position = 8616, 8512
        ]

        junction Junction4 pe
        [
            position = 8936, 9152
        ]

        junction Junction5 pe
        [
            position = 8648, 9152
        ]

        junction Junction6 pe
        [
            position = 8568, 9152
        ]

        connect Tr1.prm_1 "Grid Simulator1.Phase A" as Connection1
        connect Tr1.prm_2 "Grid Simulator1.Phase B" as Connection2
        connect Tr1.prm_3 "Grid Simulator1.Phase C" as Connection3
        connect Ia1.p_node Tr1.sec_1 as Connection8
        connect Ia1.n_node "Dynamic Grid Fault1.P1" as Connection9
        connect "Dynamic Grid Fault1.P5" "Constant Impedance Load1.C" as Connection10
        connect "Dynamic Grid Fault1.P6" "Constant Impedance Load1.B" as Connection11
        connect "Dynamic Grid Fault1.P7" "Constant Impedance Load1.A" as Connection12
        connect Tr1.sec_2 "Dynamic Grid Fault1.P2" as Connection13
        connect Tr1.sec_3 "Dynamic Grid Fault1.P3" as Connection14
        connect Step1.out "Dynamic Grid Fault1.Fault in" as Connection15
        connect Junction1 "Constant Impedance Load1.N" as Connection18
        [
            breakpoints = 9224, 8512
        ]
        connect "Dynamic Grid Fault1.P8" Junction1 as Connection19
        connect Junction2 Junction1 as Connection21
        connect Tr1.n2 Junction2 as Connection22
        connect "Grid Simulator1.Neutral" Junction3 as Connection23
        [
            breakpoints = 8160, 8512
        ]
        connect Junction3 Junction2 as Connection24
        connect Tr1.n1 Junction3 as Connection25
        connect Ia2.n_node "Dynamic Grid Fault2.P1" as Connection30
        connect "Dynamic Grid Fault2.P5" "Constant Impedance Load2.C" as Connection31
        connect "Dynamic Grid Fault2.P6" "Constant Impedance Load2.B" as Connection32
        connect "Dynamic Grid Fault2.P7" "Constant Impedance Load2.A" as Connection33
        connect Step2.out "Dynamic Grid Fault2.Fault in" as Connection36
        connect Junction4 "Constant Impedance Load2.N" as Connection37
        [
            breakpoints = 9224, 9152
        ]
        connect "Dynamic Grid Fault2.P8" Junction4 as Connection38
        connect Junction5 Junction4 as Connection39
        connect "Grid Simulator2.Neutral" Junction6 as Connection41
        [
            breakpoints = 8160, 9152
        ]
        connect Junction6 Junction5 as Connection42
        connect "Grid Simulator2.Phase B" "Three-limb core (core-type) transformer.P2" as Connection44
        connect "Dynamic Grid Fault2.P3" "Three-limb core (core-type) transformer.P8" as Connection50
        [
            breakpoints = 8888, 8976; 8688, 8976
        ]
        connect Junction5 "Three-limb core (core-type) transformer.P5" as Connection45
        connect Ia2.p_node "Three-limb core (core-type) transformer.P6" as Connection46
        connect "Grid Simulator2.Phase C" "Three-limb core (core-type) transformer.P3" as Connection43
        connect "Grid Simulator2.Phase A" "Three-limb core (core-type) transformer.P1" as Connection48
        connect "Dynamic Grid Fault2.P2" "Three-limb core (core-type) transformer.P7" as Connection49
        connect Junction6 "Three-limb core (core-type) transformer.P4" as Connection47
    }

    logically_deleted {
        "Grid Simulator2"
        "Constant Impedance Load2"
        "Ia2"
        "Dynamic Grid Fault2"
        "Step2"
        "Junction4"
        "Junction5"
        "Junction6"
        "Connection30"
        "Connection31"
        "Connection32"
        "Connection33"
        "Connection36"
        "Connection37"
        "Connection38"
        "Connection39"
        "Connection41"
        "Connection42"
        "Three-limb core (core-type) transformer"
        "Connection44"
        "Connection50"
        "Connection45"
        "Connection46"
        "Connection43"
        "Connection48"
        "Connection49"
        "Connection47"
    }

    default {
        "core/Step" {
            step_time = "1"
            initial_value = "0"
            final_value = "1"
            signal_type = "real"
            execution_rate = "100e-6"
        }

        "core/Constant Impedance Load" {
            fn = "60"
            conn_type = "Y"
            enable_neutral = "False"
            set_balanced = "True"
            Vn_3ph = "480"
            Sn_3ph = "1.0e6"
            pf_mode_3ph = "Unit"
            pf_3ph = "0.9"
            VAn = "480/(3**0.5)"
            VAB = "480"
            SAn = "1.0e6/3"
            SAB = "1.0e6/3"
            pf_modeA = "Unit"
            pfA = "0.9"
            VBn = "480/(3**0.5)"
            VBC = "480"
            SBn = "1.0e6/3"
            SBC = "1.0e6/3"
            pf_modeB = "Unit"
            pfB = "0.9"
            VCn = "480/(3**0.5)"
            VCA = "480"
            SCn = "1.0e6/3"
            SCA = "1.0e6/3"
            pf_modeC = "Unit"
            pfC = "0.9"
        }

        "core/Current Measurement" {
            signal_access = "inherit"
            bw_limit = "False"
            frequency = "10e3"
            comparator_enable = "False"
            operator = "greater"
            threshold = "0"
            cmp_abs_value = "False"
            feed_forward = "false"
            sig_output = "False"
            sig_output_filt_and_full_bw = "False"
            execution_rate = "100e-6"
            addr = "0"
            nd_msr_estimation = "false"
            dev_cpl_msr = "false"
            host_device = "0"
            output_to_device = "0"
            dev_cpl_index = "0"
            dev_cpl_var_nb = "0"
            visible = "True"
            override_signal_name = "False"
            signal_name = ""
        }

        "core/Dynamic Grid Fault" {
            ctrl_method = "SCADA input"
            Rph_ph = "0.1"
            Rph_n = "0.1"
            execution_rate = "100e-6"
        }

        "core/Grid Simulator" {
            model_definition = "R-L"
            Vb = "400"
            f = "50"
            resistance_grid_simulator = "1.0"
            inductance_grid_simulator = "1e-3"
            Sb = "1e6"
            pf = "0.1"
            x_r_ratio = "5"
        }

        "core/Three Phase Two Winding Transformer" {
            input = "SC and OC tests"
            Sn = "160000.0"
            f = "50.0"
            V1 = "10000.0"
            V2 = "400.0"
            usc1 = "4.0"
            Psc1 = "2350.0"
            R1 = "4.58984375"
            L1 = ".0370093710364"
            R2 = ".00734375"
            L2 = "5.92149936583e-05"
            r1 = ".00734375"
            l1 = ".0186029389059"
            r2 = ".00734375"
            l2 = ".0186029389059"
            core_model = "Linear"
            ioc1 = "0.7"
            Poc1 = "460.0"
            Rm = "217391.304348"
            Lm = "311.709196788"
            flux_vals_SI = "[0, 1910.3, 2419.7]"
            current_vals_SI = "[0, 0.66653, 277.72]"
            rm = "347.826086957"
            lm = "156.68213163"
            flux_vals_pu = "[0, 1.2, 1.52]"
            current_vals_pu = "[0, 0.0024, 1]"
            flux_vals_SCOC = "[0, 1.2, 1.52]"
            current_vals_SCOC = "[0, 0.0024, 1]"
            upper_flux_vals_pu = "[0.2, 1.2, 1.52]"
            upper_flux_vals_SI = "[318.33, 1910.3, 2419.7]"
            upper_flux_vals_SCOC = "[0.2, 1.2, 1.52]"
            hysteresis_number = "1"
            execution_rate = "100e-6"
            import_from_SI2SCOC = "Import from SI"
            import_from_pu2SCOC = "Import from PU"
            import_from_SCOC2SI = "Import from SC OC"
            import_from_pu2SI = "Import from PU"
            import_from_SCOC2pu = "Import from SC OC"
            import_from_SI2pu = "Import from SI"
            preview_flux_current = "Preview SI"
            winding_1_connection = "Y"
            winding_2_connection = "Y"
            clock_number = "0"
            embedded_cpl = "None"
            coupling_type = "core"
            ratio_type = "Automatic"
            ratio = "0.1"
            Rshunt = "inf"
        }
    }
}
