Skip to content

Instantly share code, notes, and snippets.

@kumajaya
Created May 12, 2025 18:21
Show Gist options
  • Select an option

  • Save kumajaya/0e1a98b99d824d67b14f5f8a00e4afaf to your computer and use it in GitHub Desktop.

Select an option

Save kumajaya/0e1a98b99d824d67b14f5f8a00e4afaf to your computer and use it in GitHub Desktop.
Calculate centrifugal compressor flow from known motor power
FUNCTION_BLOCK CompressorCalc
VAR_INPUT
Q_design : REAL;
T_design : REAL;
PR_design : REAL;
P_design : REAL;
T_real : REAL;
PR_real : REAL;
P_real : REAL;
END_VAR
VAR_OUTPUT
Q_real : REAL;
END_VAR
VAR
ratio : REAL;
END_VAR
(* Hitung Q_real jika diketahui P_real *)
IF (T_real <> 0.0) AND (PR_real <> 0.0) AND (P_design <> 0.0) THEN
ratio := (T_design / T_real) * (PR_design / PR_real) * (P_real / P_design);
Q_real := Q_design * SQRT(ratio);
ELSE
Q_real := 0.0;
END_IF;
END_FUNCTION_BLOCK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment