{
  "name": "Air-Cooled Chiller R134a (4-Port Modelica Style)",
  "description": "Full emergent-pressure chiller. Condenser on air (AirSource→cond→AirSink), evaporator on chilled water (BrineSource→evap→BrineSink). MassFlowSource_T: Free P + Fixed ṁ/T; sinks Fixed P. secondary_humidity_ratio MUST match AirSource psychrometrics (W at T_dry, RH, P).",

  "fluid": "R134a",
  "fluid_backend": "CoolProp",

  "circuits": [
    {
      "id": 0,
      "name": "Refrigerant + secondary loops",
      "components": [
        {
          "type": "IsentropicCompressor",
          "name": "comp",
          "isentropic_efficiency": 0.70,
          "t_cond_k": 318.15,
          "t_evap_k": 278.15,
          "superheat_k": 5.0,
          "emergent_pressure": true,
          "displacement_m3": 6.5e-5,
          "speed_hz": 50.0,
          "volumetric_efficiency": 0.92
        },
        {
          "type": "Condenser",
          "name": "cond",
          "ua": 2500.0,
          "emergent_pressure": true,
          "subcooling_k": 5.0,
          "secondary_fluid": "Air",
          "secondary_humidity_ratio": 0.01412,
          "dp_model": "isobaric",
          "secondary_rated_pressure_drop_pa": 150,
          "secondary_rated_m_flow_kg_s": 1.2
        },
        {
          "type": "IsenthalpicExpansionValve",
          "name": "exv",
          "t_evap_k": 278.15,
          "emergent_pressure": true
        },
        {
          "type": "Evaporator",
          "name": "evap",
          "ua": 1468.0,
          "emergent_pressure": true,
          "secondary_fluid": "Water",
          "dp_model": "isobaric",
          "secondary_rated_pressure_drop_pa": 40000,
          "secondary_rated_m_flow_kg_s": 0.4778
        },
        {
          "type": "AirSource",
          "name": "cond_air_in",
          "p_set_bar": 1.01325,
          "t_dry_c": 35.0,
          "rh": 40.0,
          "m_flow_kg_s": 1.2,
          "fix_pressure": false,
          "fix_temperature": true,
          "fix_mass_flow": true
        },
        {
          "type": "AirSink",
          "name": "cond_air_out",
          "p_back_bar": 1.01325,
          "fix_pressure": true
        },
        {
          "type": "BrineSource",
          "name": "evap_water_in",
          "fluid": "Water",
          "p_set_bar": 3.0,
          "t_set_c": 12.0,
          "m_flow_kg_s": 0.4778,
          "fix_pressure": false,
          "fix_temperature": true,
          "fix_mass_flow": true
        },
        {
          "type": "BrineSink",
          "name": "evap_water_out",
          "fluid": "Water",
          "p_back_bar": 3.0,
          "fix_pressure": true
        }
      ],
      "edges": [
        { "from": "comp:outlet", "to": "cond:inlet" },
        { "from": "cond:outlet", "to": "exv:inlet" },
        { "from": "exv:outlet", "to": "evap:inlet" },
        { "from": "evap:outlet", "to": "comp:inlet" },
        { "from": "cond_air_in:outlet", "to": "cond:secondary_inlet" },
        { "from": "cond:secondary_outlet", "to": "cond_air_out:inlet" },
        { "from": "evap_water_in:outlet", "to": "evap:secondary_inlet" },
        { "from": "evap:secondary_outlet", "to": "evap_water_out:inlet" }
      ]
    }
  ],

  "solver": {
    "strategy": "newton",
    "max_iterations": 300,
    "tolerance": 1e-6
  }
}
