Example PGM File - Estimate Belt Filter Wash Loss Curve based on Washing Efficiency

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: PGMs ➔ Example PGM Files ➔ Belt Filter Wash Loss

Simple Examples Subroutines Examples Dynamic Examples Steady State Overall Mass Balance Array and Matrix Examples
Basic
Layout
Simple
Calculations
Initialise
PreStart
Multi-Step Trigger Checking
Project
Counter, While
and Random
Belt Filter
Wash Loss
Startup
Actions
Mass
Balance
Mass
Balance
Species
Balance
Elemental
Balance
Lookup
Value
Set
Values
Tridiagonal
System

Related Links: Trigger Subroutines, Belt Filter (Hints and Comments)


This example can be used to set WashLoss curve once (during initialisation), based on user-specified Single Filtration Wash (SFW) efficiency.

  • Note that this example can be extended to set WashLoss curve by adjusting the "user-specified SFW efficiency" to meet the overall belt filter wash efficiency. The Overall wash efficiency setpoint and SFW adjustment is done via a PID controller.
PageLabel "WashEff" 
 Textbreak
 String BF_TagName{Tag}
 Byte	Num_Stages@, i, Num_DataPoints
 Textbreak
 Real   SFW_Eff_Req*("Frac", "%"){Comment("Single Stage")}, SVW_Eff_Calc@("Frac", "%"){Comment("Single Volume")}
 Real   Wash_Ratio@
 Real	BT_OverallWashEff@("Frac", "%"), Prev_Val, Slope
;----------------------------  
Sub WashLossDataPointsCalc()
  Slope = Log((100-SFW_Eff_Req)/100)/Wash_Ratio
  i = 0
  While i < Num_DataPoints
    [Concatenate(BF_TagName,".WashLoss.I", IntToStr(i+1), ".X")] = i
    [Concatenate(BF_TagName,".WashLoss.I", IntToStr(i+1), ".Y")] = 10^(Slope*i)
    i = i + 1
  Endwhile
EndSub
;----------------------------
Sub InitialiseSolution()
  Num_Stages     = [Concatenate(BF_TagName, ".Stages")]
  Num_DataPoints = [Concatenate(BF_TagName, ".WashLoss.Length")]
  Wash_Ratio     = [Concatenate(BF_TagName, ".WashRatio")]
  SVW_Eff_Calc   = (1-Pow((100-SFW_Eff_Req)/100,1/Wash_Ratio))*100
  Prev_Val       = SVW_Eff_Calc
  WashLossDataPointsCalc()
EndSub
;--- Logic - executed at EVERY step ---
  Wash_Ratio = [Concatenate(BF_TagName,".WashRatio")]
  SVW_Eff_Calc = (1-Pow((100-SFW_Eff_Req)/100,1/Wash_Ratio))*100

  If SVW_Eff_Calc != Prev_Val
    WashLossDataPointsCalc()
    Prev_Val = SVW_Eff_Calc
  Endif

  BT_OverallWashEff = [Concatenate(BF_TagName,".WashEff (%)")]
$ ; --- end of file ---