@@ -1514,13 +1514,13 @@ def _get_default_mass_outflow_udd(entities, mass_flow_rate):
15141514 "Kp" : proportional_coefficient ,
15151515 "initialStaticPressureRatio" : 1.0 ,
15161516 },
1517- output_vars = {
1518- "staticPressureRatio" : "if (pseudoStep > 0) state[0]; else initialStaticPressureRatio;"
1519- },
1517+ output_vars = {"staticPressureRatio" : "state[0];" },
15201518 state_vars_initial_value = ["initialStaticPressureRatio" ],
15211519 update_law = [
1522- "if (hasSupersonicFlow and massFlowRate > 0) (1.0 + Kp) * state[0]; else state[0] + "
1523- + "Kp * (massFlowRate/area - massFlowRateTarget/area);"
1520+ "(pseudoStep > 0) ? ("
1521+ "(hasSupersonicFlow and massFlowRate > 0) ? ((1.0 + Kp) * state[0]) : (state[0] + "
1522+ "Kp * (massFlowRate/area - massFlowRateTarget/area))"
1523+ ") : (state[0]);"
15241524 ],
15251525 input_boundary_patches = entities .stored_entities ,
15261526 output_target = entity ,
@@ -1543,13 +1543,13 @@ def _get_default_mass_inflow_udd(entities, mass_flow_rate):
15431543 "Kp" : proportional_coefficient ,
15441544 "initialTotalPressureRatio" : 1.0 ,
15451545 },
1546- output_vars = {
1547- "totalPressureRatio" : "if (pseudoStep > 0) state[0]; else initialTotalPressureRatio;"
1548- },
1546+ output_vars = {"totalPressureRatio" : "state[0];" },
15491547 state_vars_initial_value = ["initialTotalPressureRatio" ],
15501548 update_law = [
1551- "if (hasSupersonicFlow and massFlowRate > 0) (1.0 - Kp) * state[0]; else state[0] - "
1552- + "Kp * (massFlowRate/area - massFlowRateTarget/area);"
1549+ "(pseudoStep > 0) ? ("
1550+ "(hasSupersonicFlow and massFlowRate > 0) ? ((1.0 - Kp) * state[0]) : (state[0] - "
1551+ "Kp * (massFlowRate/area - massFlowRateTarget/area))"
1552+ ") : (state[0]);"
15531553 ],
15541554 input_boundary_patches = entities .stored_entities ,
15551555 output_target = entity ,
0 commit comments