WasteWater.ASM2d

Component models for the Activated Sludge Model No.2d

WasteWater.ASM2d.deni WasteWater.ASM2d.nitri WasteWater.ASM2d.precipitation WasteWater.ASM2d.SecClarModTakacs WasteWater.ASM2d.blower WasteWater.ASM2d.pump WasteWater.ASM2d.FlowSource WasteWater.ASM2d.WWSource WasteWater.ASM2d.EffluentSink WasteWater.ASM2d.SludgeSink WasteWater.ASM2d.ControlledDivider2 WasteWater.ASM2d.divider2 WasteWater.ASM2d.mixer2 WasteWater.ASM2d.mixer3 WasteWater.ASM2d.sensor_COD WasteWater.ASM2d.sensor_NH WasteWater.ASM2d.sensor_NO WasteWater.ASM2d.sensor_O2 WasteWater.ASM2d.sensor_PO WasteWater.ASM2d.sensor_Q WasteWater.ASM2d.sensor_TKN WasteWater.ASM2d.sensor_TP WasteWater.ASM2d.sensor_TSS WasteWater.ASM2d.Examples WasteWater.ASM2d.Interfaces WasteWater.ASM2d.PreClar WasteWater.ASM2d.SecClar

Information

This library contains components to build models of biological municipal
wastewater treatment plants based on the Activated Sludge Model No.2d (ASM2d) by the
International Association on Water Quality (IAWQ) [1].


The library currently is structured in following sub-libraries.

  Interfaces 
 - partial ASM2d models and connectors
  PreClar 
 - primary clarifier models
  SecClar 
 - several secondary settling tank models
  Examples 
 - wastewater treatment plant models

Main Author:
 
          Gerald Reichl
          Technische Universitaet Ilmenau
          Faculty of Informatics and Automation
          Department Dynamics and Simulation of ecological Systems
          P.O. Box 10 05 65
          98684 Ilmenau
          Germany
          email: gerald.reichl@tu-ilmenau.de


References:

[1] M. Henze and W.Gujer and T. Mino and. M.v. Loosdrecht: Activated Sludge
      Models ASM1, ASM2, ASM2d, and ASM3. IWA Task Group on Mathematical Modelling
      for Design and Operation of Biological Wastewater Treatment, 2000.


Copyright (C) 2002 - 2003, Gerald Reichl

The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".


WasteWater.ASM2d.deni WasteWater.ASM2d.deni

ASM2d denitrification tank

WasteWater.ASM2d.deni

Information

This component models the ASM2d processes and reactions taking place in an unaerated (denitrification) tank
of a wastewater treatment plant.

The InPort signal gives the tank temperature to the model.

Parameters

All conversion factors and soichiometric and kinetic parameters of the activated sludge model No.2d (ASM2d).

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]
f_Si0.0Production of Si in hydrolysis [gCOD/gCOD]
Y_H0.625Yield coefficient [gCOD/gCOD]
f_Xih0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_PAO0.625Yield coefficient (biomass/PHA) [gCOD/gCOD]
Y_PO0.4PP requirement (PO4 release) per PHA stored [gP/gCOD]
Y_PHA0.2PHA requirement for PP storage [gCOD/gP]
f_Xip0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_A0.24Yield of autotrophic biomass per NO3-N [gCOD/gN]
f_Xia0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
v_1_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si  
v_2_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si  
v_3_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si  
v_4_NHi_N_Sf/Y_H - i_N_BM  
v_5_NH-i_N_BM 
v_6_NHi_N_Sf/Y_H - i_N_BM  
v_7_NH-i_N_BM 
v_8_NHi_N_Sf 
v_9_NHi_N_BM - f_Xih*i_N_Xi - (1 - f_Xih)*i_N_Xs  
v_13_NH-i_N_BM 
v_14_NH-i_N_BM 
v_15_NHi_N_BM - f_Xip*i_N_Xi - (1 - f_Xip)*i_N_Xs  
v_18_NH-1/Y_A - i_N_BM  
v_19_NHi_N_BM - f_Xia*i_N_Xi - (1 - f_Xia)*i_N_Xs  
v_1_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si  
v_2_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si  
v_3_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si  
v_4_POi_P_Sf/Y_H - i_P_BM  
v_5_PO-i_P_BM 
v_6_POi_P_Sf/Y_H - i_P_BM  
v_7_PO-i_P_BM 
v_8_POi_P_Sf 
v_9_POi_P_BM - f_Xih*i_P_Xi - (1 - f_Xih)*i_P_Xs  
v_15_POi_P_BM - f_Xip*i_P_Xi - (1 - f_Xip)*i_P_Xs  
v_19_POi_P_BM - f_Xia*i_P_Xi - (1 - f_Xia)*i_P_Xs  
v_12_NO-Y_PHA/2.86 
v_14_NO-(1 - Y_PAO)/(2.86*Y_PAO)  
v_12_N2-v_12_NO 
v_14_N2-v_14_NO 
v_1_ALKv_1_NH/14 + v_1_PO*(-1.5/31)  
v_2_ALKv_2_NH/14 + v_2_PO*(-1.5/31)  
v_3_ALKv_3_NH/14 + v_3_PO*(-1.5/31)  
v_4_ALKv_4_NH/14 + v_4_PO*(-1.5/31)  
v_5_ALK1/(Y_H*64) + v_5_NH/14 + v_5_PO*(-1.5/31)  
v_6_ALKv_6_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_6_PO*(-1.5/31)  
v_7_ALK1/(Y_H*64) + v_7_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_7_PO*(-1.5/31)  
v_8_ALKv_8_NH/14 + v_8_PO*(-1.5/31) - 1/64  
v_9_ALKv_9_NH/14 + v_9_PO*(-1.5/31)  
v_10_ALK1/64 + Y_PO*(-1.5/31) - Y_PO*(-1/31)  
v_11_ALK(1.5 - 1)/31  
v_12_ALKv_12_NO*(-1/14) + (1.5 - 1)/31  
v_13_ALKv_13_NH/14 - i_P_BM*(-1.5/31)  
v_14_ALKv_14_NH/14 - v_14_NO/14 - i_P_BM*(-1.5/31)  
v_15_ALKv_15_NH/14 + v_15_PO*(-1.5/31)  
v_16_ALK(1 - 1.5)/31  
v_17_ALK-1/64 
v_18_ALKv_18_NH/14 - 1/(Y_A*14) - i_P_BM*(-1.5/31)  
v_19_ALKv_19_NH/14 + v_19_PO*(-1.5/31)  
v_20_ALK1.5/31 
v_21_ALK-1.5/31 
v_1_TSS-i_TSS_Xs 
v_2_TSS-i_TSS_Xs 
v_3_TSS-i_TSS_Xs 
v_4_TSSi_TSS_BM 
v_5_TSSi_TSS_BM 
v_6_TSSi_TSS_BM 
v_7_TSSi_TSS_BM 
v_9_TSSf_Xih*i_TSS_Xi + (1 - f_Xih)*i_TSS_Xs - i_TSS_BM  
v_10_TSS-Y_PO*3.23 + 0.6  
v_11_TSS3.23 - Y_PHA*0.6  
v_12_TSS3.23 - Y_PHA*0.6  
v_13_TSSi_TSS_BM - 0.6/Y_PAO  
v_14_TSSi_TSS_BM - 0.6/Y_PAO  
v_15_TSSf_Xip*i_TSS_Xi + (1 - f_Xip)*i_TSS_Xs - i_TSS_BM  
v_16_TSS-3.23 
v_17_TSS-0.6 
v_18_TSSi_TSS_BM 
v_19_TSSf_Xia*i_TSS_Xi + (1 - f_Xia)*i_TSS_Xs - i_TSS_BM  
v_13_O-(1 - Y_PAO)/Y_PAO  
K_h_T3.0Hydrolysis rate at T=20 deg C [d^-1]
eta_NO_Xs0.6Anoxic hydrolysis reduction factor [-]
eta_fe0.4Anaerobic hydrolysis reduction factor [-]
K_O_Xs0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xs0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_X0.1Saturation coefficient for particulate COD [g Xs/(g Xh)]
mu_H_T6.0Maximum growth rate on substrate at T=20 deg C [g Xs/(g Xh)/d]
rho_fe_T3.0Maximum rate for fermentation at T=20 deg C [g Sf/(g Xh)/d]
eta_NO_Xh0.8Reduction factor for denitrification [-]
b_H_T0.4Rate for lysis and decay at T=20 deg C [d^-1]
K_O_Xh0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_F4.0Saturation coefficient for growth on Sf [g COD/m3]
K_fe4.0Saturation coefficient for fermentation of Sf [g COD/m3]
K_A_Xh4.0Saturation coefficient for growth on acetate Sa [g COD/m3]
K_NO_Xh0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_NH_Xh0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_P_Xh0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xh0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
rho_PHA_T3.0Rate for storage of Xpha (base Xpp) at T=20 deg C [g Xpha/(g Xpao)/d]
rho_PP_T1.5Rate for storage of Xpp at T=20 deg C [g Xpp/(g Xpao)/d]
mu_PAO_T1.0Maximum growth rate of PAO at T=20 deg C [d^-1]
eta_NO_Xpao0.6Reduction factor for anoxic activity [-]
b_PAO_T0.2Rate for lysis of Xpao at T=20 deg C [d^-1]
b_PP_T0.2Rate for lysis of Xpp at T=20 dedg C [d^-1]
b_PHA_T0.2Rate for lysis of Xpha at T=20 deg C [d^-1]
K_O_Xpao0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xpao0.5Saturation coefficient for nitrate, Sno3 [g N/m3]
K_A_Xpao4.0Saturation coefficient for acetate, Sa [g COD/m3]
K_NH_Xpao0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_PS0.2Saturation coefficient for phosphorus in storage of PP [g P/m3]
K_P_Xpao0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xpao0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_PP0.01Saturation coefficient for poly-phosphate [g Xpp/(g Xpao)]
K_MAX0.34Maximum ratio of Xpp/Xpao [g Xpp/(g Xpao)]
K_IPP0.02Inhibition coefficient for PP storage [g Xpp/(g Xpao)]
K_PHA0.01Saturation coefficient for PHA [g Xpha/(g Xpao)]
mu_AUT_T1.0Maximum growth rate of Xa at T=20 deg C [d^-1]
b_AUT_T0.15Decay rate of Xa at T=20 deg C [d^-1]
K_O_Xa0.5Saturation coefficient for oxygen [g O2/m3]
K_NH_Xa1.0Saturation coefficient for ammonium (substrate) [g N/m3]
K_ALK_Xa0.5Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_P_Xa0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
k_PRE1.0Rate constant for P precipitation [m3/(g Fe(OH3))/d]
k_RED0.6Rate constant for redissolution [d^-1]
K_ALK_Pre0.5Saturation coefficient for alkalinity [mole HCO3/m3]
V1000Volume of denitrification tank [m3]

Modelica definition

model deni "ASM2d denitrification tank" 
  //denitrifikation tank based on the ASM2d model

  extends WasteWater.Icons.deni;
  extends Interfaces.ASM2dbase;
  
  // tank specific parameters
  parameter Modelica.SIunits.Volume V=1000 "Volume of denitrification tank";
  
  // following 4 connectors are already in ASM2dbase and are inherited,
  // but listed hear again to avoid an icon related problem
  // with the sequence of extends-clauses
    Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out;
  Interfaces.WWFlowAsm2dout MeasurePort;
  Modelica.Blocks.Interfaces.InPort T(final n=1);
equation 
  
  aeration = 0;
  // no aeration in this tank //
  
  // volume dependent dilution term of each concentration
  
  inputSo = (In.So - So)*In.Q/V;
  inputSf = (In.Sf - Sf)*In.Q/V;
  inputSa = (In.Sa - Sa)*In.Q/V;
  inputSnh = (In.Snh - Snh)*In.Q/V;
  inputSno = (In.Sno - Sno)*In.Q/V;
  inputSpo = (In.Spo - Spo)*In.Q/V;
  inputSi = (In.Si - Si)*In.Q/V;
  inputSalk = (In.Salk - Salk)*In.Q/V;
  inputSn2 = (In.Sn2 - Sn2)*In.Q/V;
  inputXi = (In.Xi - Xi)*In.Q/V;
  inputXs = (In.Xs - Xs)*In.Q/V;
  inputXh = (In.Xh - Xh)*In.Q/V;
  inputXpao = (In.Xpao - Xpao)*In.Q/V;
  inputXpp = (In.Xpp - Xpp)*In.Q/V;
  inputXpha = (In.Xpha - Xpha)*In.Q/V;
  inputXa = (In.Xa - Xa)*In.Q/V;
  inputXtss = (In.Xtss - Xtss)*In.Q/V;
  inputXmeoh = (In.Xmeoh - Xmeoh)*In.Q/V;
  inputXmep = (In.Xmep - Xmep)*In.Q/V;
  
end deni;

WasteWater.ASM2d.nitri WasteWater.ASM2d.nitri

ASM2d nitrification tank

WasteWater.ASM2d.nitri

Information

This component models the ASM2d processes and reactions taking place in an 
aerated (nitrification) tank of a wastewater treatment plant.

The InPort signal gives the tank temperature to the model.

Parameters

All conversion factors and soichiometric and kinetic parameters of the activated sludge model No.2d (ASM2d)

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]
f_Si0.0Production of Si in hydrolysis [gCOD/gCOD]
Y_H0.625Yield coefficient [gCOD/gCOD]
f_Xih0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_PAO0.625Yield coefficient (biomass/PHA) [gCOD/gCOD]
Y_PO0.4PP requirement (PO4 release) per PHA stored [gP/gCOD]
Y_PHA0.2PHA requirement for PP storage [gCOD/gP]
f_Xip0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_A0.24Yield of autotrophic biomass per NO3-N [gCOD/gN]
f_Xia0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
v_1_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_2_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_3_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_4_NHi_N_Sf/Y_H - i_N_BM 
v_5_NH-i_N_BM 
v_6_NHi_N_Sf/Y_H - i_N_BM 
v_7_NH-i_N_BM 
v_8_NHi_N_Sf 
v_9_NHi_N_BM - f_Xih*i_N_Xi - (1 - f_Xih)*i_N_Xs 
v_13_NH-i_N_BM 
v_14_NH-i_N_BM 
v_15_NHi_N_BM - f_Xip*i_N_Xi - (1 - f_Xip)*i_N_Xs 
v_18_NH-1/Y_A - i_N_BM 
v_19_NHi_N_BM - f_Xia*i_N_Xi - (1 - f_Xia)*i_N_Xs 
v_1_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_2_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_3_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_4_POi_P_Sf/Y_H - i_P_BM 
v_5_PO-i_P_BM 
v_6_POi_P_Sf/Y_H - i_P_BM 
v_7_PO-i_P_BM 
v_8_POi_P_Sf 
v_9_POi_P_BM - f_Xih*i_P_Xi - (1 - f_Xih)*i_P_Xs 
v_15_POi_P_BM - f_Xip*i_P_Xi - (1 - f_Xip)*i_P_Xs 
v_19_POi_P_BM - f_Xia*i_P_Xi - (1 - f_Xia)*i_P_Xs 
v_12_NO-Y_PHA/2.86 
v_14_NO-(1 - Y_PAO)/(2.86*Y_PAO) 
v_12_N2-v_12_NO 
v_14_N2-v_14_NO 
v_1_ALKv_1_NH/14 + v_1_PO*(-1.5/31) 
v_2_ALKv_2_NH/14 + v_2_PO*(-1.5/31) 
v_3_ALKv_3_NH/14 + v_3_PO*(-1.5/31) 
v_4_ALKv_4_NH/14 + v_4_PO*(-1.5/31) 
v_5_ALK1/(Y_H*64) + v_5_NH/14 + v_5_PO*(-1.5/31) 
v_6_ALKv_6_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_6_PO*(-1.5/31) 
v_7_ALK1/(Y_H*64) + v_7_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_7_PO*(-1.5/31) 
v_8_ALKv_8_NH/14 + v_8_PO*(-1.5/31) - 1/64 
v_9_ALKv_9_NH/14 + v_9_PO*(-1.5/31) 
v_10_ALK1/64 + Y_PO*(-1.5/31) - Y_PO*(-1/31) 
v_11_ALK(1.5 - 1)/31 
v_12_ALKv_12_NO*(-1/14) + (1.5 - 1)/31 
v_13_ALKv_13_NH/14 - i_P_BM*(-1.5/31) 
v_14_ALKv_14_NH/14 - v_14_NO/14 - i_P_BM*(-1.5/31) 
v_15_ALKv_15_NH/14 + v_15_PO*(-1.5/31) 
v_16_ALK(1 - 1.5)/31 
v_17_ALK-1/64 
v_18_ALKv_18_NH/14 - 1/(Y_A*14) - i_P_BM*(-1.5/31) 
v_19_ALKv_19_NH/14 + v_19_PO*(-1.5/31) 
v_20_ALK1.5/31 
v_21_ALK-1.5/31 
v_1_TSS-i_TSS_Xs 
v_2_TSS-i_TSS_Xs 
v_3_TSS-i_TSS_Xs 
v_4_TSSi_TSS_BM 
v_5_TSSi_TSS_BM 
v_6_TSSi_TSS_BM 
v_7_TSSi_TSS_BM 
v_9_TSSf_Xih*i_TSS_Xi + (1 - f_Xih)*i_TSS_Xs - i_TSS_BM 
v_10_TSS-Y_PO*3.23 + 0.6 
v_11_TSS3.23 - Y_PHA*0.6 
v_12_TSS3.23 - Y_PHA*0.6 
v_13_TSSi_TSS_BM - 0.6/Y_PAO 
v_14_TSSi_TSS_BM - 0.6/Y_PAO 
v_15_TSSf_Xip*i_TSS_Xi + (1 - f_Xip)*i_TSS_Xs - i_TSS_BM 
v_16_TSS-3.23 
v_17_TSS-0.6 
v_18_TSSi_TSS_BM 
v_19_TSSf_Xia*i_TSS_Xi + (1 - f_Xia)*i_TSS_Xs - i_TSS_BM 
v_13_O-(1 - Y_PAO)/Y_PAO 
K_h_T3.0Hydrolysis rate at T=20 deg C [d^-1]
eta_NO_Xs0.6Anoxic hydrolysis reduction factor [-]
eta_fe0.4Anaerobic hydrolysis reduction factor [-]
K_O_Xs0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xs0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_X0.1Saturation coefficient for particulate COD [g Xs/(g Xh)]
mu_H_T6.0Maximum growth rate on substrate at T=20 deg C [g Xs/(g Xh)/d]
rho_fe_T3.0Maximum rate for fermentation at T=20 deg C [g Sf/(g Xh)/d]
eta_NO_Xh0.8Reduction factor for denitrification [-]
b_H_T0.4Rate for lysis and decay at T=20 deg C [d^-1]
K_O_Xh0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_F4.0Saturation coefficient for growth on Sf [g COD/m3]
K_fe4.0Saturation coefficient for fermentation of Sf [g COD/m3]
K_A_Xh4.0Saturation coefficient for growth on acetate Sa [g COD/m3]
K_NO_Xh0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_NH_Xh0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_P_Xh0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xh0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
rho_PHA_T3.0Rate for storage of Xpha (base Xpp) at T=20 deg C [g Xpha/(g Xpao)/d]
rho_PP_T1.5Rate for storage of Xpp at T=20 deg C [g Xpp/(g Xpao)/d]
mu_PAO_T1.0Maximum growth rate of PAO at T=20 deg C [d^-1]
eta_NO_Xpao0.6Reduction factor for anoxic activity [-]
b_PAO_T0.2Rate for lysis of Xpao at T=20 deg C [d^-1]
b_PP_T0.2Rate for lysis of Xpp at T=20 dedg C [d^-1]
b_PHA_T0.2Rate for lysis of Xpha at T=20 deg C [d^-1]
K_O_Xpao0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xpao0.5Saturation coefficient for nitrate, Sno3 [g N/m3]
K_A_Xpao4.0Saturation coefficient for acetate, Sa [g COD/m3]
K_NH_Xpao0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_PS0.2Saturation coefficient for phosphorus in storage of PP [g P/m3]
K_P_Xpao0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xpao0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_PP0.01Saturation coefficient for poly-phosphate [g Xpp/(g Xpao)]
K_MAX0.34Maximum ratio of Xpp/Xpao [g Xpp/(g Xpao)]
K_IPP0.02Inhibition coefficient for PP storage [g Xpp/(g Xpao)]
K_PHA0.01Saturation coefficient for PHA [g Xpha/(g Xpao)]
mu_AUT_T1.0Maximum growth rate of Xa at T=20 deg C [d^-1]
b_AUT_T0.15Decay rate of Xa at T=20 deg C [d^-1]
K_O_Xa0.5Saturation coefficient for oxygen [g O2/m3]
K_NH_Xa1.0Saturation coefficient for ammonium (substrate) [g N/m3]
K_ALK_Xa0.5Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_P_Xa0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
k_PRE1.0Rate constant for P precipitation [m3/(g Fe(OH3))/d]
k_RED0.6Rate constant for redissolution [d^-1]
K_ALK_Pre0.5Saturation coefficient for alkalinity [mole HCO3/m3]
V1000Volume of nitrification tank [m3]
alpha0.7Oxygen transfer factor
de4.5depth of aeration [m]
R_air23.5specific oxygen feed factor [gO2/(m^3*m)]

Modelica definition

model nitri "ASM2d nitrification tank" 
  // nitrification (aerated) tank, based on the ASM2d model
  
  extends WasteWater.Icons.nitri;
  extends Interfaces.ASM2dbase;
  
  // aeration system dependend parameters
  parameter Modelica.SIunits.Volume V=1000 "Volume of nitrification tank";
  parameter Real alpha=0.7 "Oxygen transfer factor";
  parameter Modelica.SIunits.Length de=4.5 "depth of aeration";
  parameter Real R_air=23.5 "specific oxygen feed factor [gO2/(m^3*m)]";
  WWU.MassConcentration So_sat "Dissolved oxygen saturation";
  
  // following 4 connectors are already in ASM2dbase and are inherited,
  // but listed hear again to avoid an icon related problem
  // with the sequence of extends-clauses
    Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out;
  Interfaces.WWFlowAsm2dout MeasurePort;
  Modelica.Blocks.Interfaces.InPort T(final n=1);

  Interfaces.AirFlow AirIn;
equation 
  
  // Temperature dependend oxygen saturation by Simba
  So_sat = 13.89 + (-0.3825 + (0.007311 - 0.00006588*T.signal[1])*T.signal[1])*
    T.signal[1];
  
  // extends the Oxygen differential equation by an aeration term
  // aeration [mgO2/l]; AirIn.Q_air needs to be in 
  // Simulationtimeunit [m3/day^-1]
  aeration = (alpha*(So_sat - So)/So_sat*AirIn.Q_air*R_air*de)/V;
  // aeration = Kla * (So_sat -So);
  
  // volume dependent dilution term of each concentration  
  inputSo = (In.So - So)*In.Q/V;
  inputSf = (In.Sf - Sf)*In.Q/V;
  inputSa = (In.Sa - Sa)*In.Q/V;
  inputSnh = (In.Snh - Snh)*In.Q/V;
  inputSno = (In.Sno - Sno)*In.Q/V;
  inputSpo = (In.Spo - Spo)*In.Q/V;
  inputSi = (In.Si - Si)*In.Q/V;
  inputSalk = (In.Salk - Salk)*In.Q/V;
  inputSn2 = (In.Sn2 - Sn2)*In.Q/V;
  inputXi = (In.Xi - Xi)*In.Q/V;
  inputXs = (In.Xs - Xs)*In.Q/V;
  inputXh = (In.Xh - Xh)*In.Q/V;
  inputXpao = (In.Xpao - Xpao)*In.Q/V;
  inputXpp = (In.Xpp - Xpp)*In.Q/V;
  inputXpha = (In.Xpha - Xpha)*In.Q/V;
  inputXa = (In.Xa - Xa)*In.Q/V;
  inputXtss = (In.Xtss - Xtss)*In.Q/V;
  inputXmeoh = (In.Xmeoh - Xmeoh)*In.Q/V;
  inputXmep = (In.Xmep - Xmep)*In.Q/V;
  
end nitri;

WasteWater.ASM2d.precipitation WasteWater.ASM2d.precipitation

Phosphorus precipitation tank

WasteWater.ASM2d.precipitation

Information

This ASM2d component is used to model the chemical Phosphorus precipitation
with FeCl3 as precipitant.

Parameters

All ASM2d conversion factors and stoichiometric and kinetic parameters.

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]
f_Si0.0Production of Si in hydrolysis [gCOD/gCOD]
Y_H0.625Yield coefficient [gCOD/gCOD]
f_Xih0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_PAO0.625Yield coefficient (biomass/PHA) [gCOD/gCOD]
Y_PO0.4PP requirement (PO4 release) per PHA stored [gP/gCOD]
Y_PHA0.2PHA requirement for PP storage [gCOD/gP]
f_Xip0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
Y_A0.24Yield of autotrophic biomass per NO3-N [gCOD/gN]
f_Xia0.1Fraction of inert COD generated in biomass lysis [gCOD/gCOD]
v_1_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_2_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_3_NHi_N_Xs - (1 - f_Si)*i_N_Sf - f_Si*i_N_Si 
v_4_NHi_N_Sf/Y_H - i_N_BM 
v_5_NH-i_N_BM 
v_6_NHi_N_Sf/Y_H - i_N_BM 
v_7_NH-i_N_BM 
v_8_NHi_N_Sf 
v_9_NHi_N_BM - f_Xih*i_N_Xi - (1 - f_Xih)*i_N_Xs 
v_13_NH-i_N_BM 
v_14_NH-i_N_BM 
v_15_NHi_N_BM - f_Xip*i_N_Xi - (1 - f_Xip)*i_N_Xs 
v_18_NH-1/Y_A - i_N_BM 
v_19_NHi_N_BM - f_Xia*i_N_Xi - (1 - f_Xia)*i_N_Xs 
v_1_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_2_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_3_POi_P_Xs - (1 - f_Si)*i_P_Sf - f_Si*i_P_Si 
v_4_POi_P_Sf/Y_H - i_P_BM 
v_5_PO-i_P_BM 
v_6_POi_P_Sf/Y_H - i_P_BM 
v_7_PO-i_P_BM 
v_8_POi_P_Sf 
v_9_POi_P_BM - f_Xih*i_P_Xi - (1 - f_Xih)*i_P_Xs 
v_15_POi_P_BM - f_Xip*i_P_Xi - (1 - f_Xip)*i_P_Xs 
v_19_POi_P_BM - f_Xia*i_P_Xi - (1 - f_Xia)*i_P_Xs 
v_12_NO-Y_PHA/2.86 
v_14_NO-(1 - Y_PAO)/(2.86*Y_PAO) 
v_12_N2-v_12_NO 
v_14_N2-v_14_NO 
v_1_ALKv_1_NH/14 + v_1_PO*(-1.5/31) 
v_2_ALKv_2_NH/14 + v_2_PO*(-1.5/31) 
v_3_ALKv_3_NH/14 + v_3_PO*(-1.5/31) 
v_4_ALKv_4_NH/14 + v_4_PO*(-1.5/31) 
v_5_ALK1/(Y_H*64) + v_5_NH/14 + v_5_PO*(-1.5/31) 
v_6_ALKv_6_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_6_PO*(-1.5/31) 
v_7_ALK1/(Y_H*64) + v_7_NH/14 + (1 - Y_H)/(2.86*Y_H*14) + v_7_PO*(-1.5/31) 
v_8_ALKv_8_NH/14 + v_8_PO*(-1.5/31) - 1/64 
v_9_ALKv_9_NH/14 + v_9_PO*(-1.5/31) 
v_10_ALK1/64 + Y_PO*(-1.5/31) - Y_PO*(-1/31) 
v_11_ALK(1.5 - 1)/31 
v_12_ALKv_12_NO*(-1/14) + (1.5 - 1)/31 
v_13_ALKv_13_NH/14 - i_P_BM*(-1.5/31) 
v_14_ALKv_14_NH/14 - v_14_NO/14 - i_P_BM*(-1.5/31) 
v_15_ALKv_15_NH/14 + v_15_PO*(-1.5/31) 
v_16_ALK(1 - 1.5)/31 
v_17_ALK-1/64 
v_18_ALKv_18_NH/14 - 1/(Y_A*14) - i_P_BM*(-1.5/31) 
v_19_ALKv_19_NH/14 + v_19_PO*(-1.5/31) 
v_20_ALK1.5/31 
v_21_ALK-1.5/31 
v_1_TSS-i_TSS_Xs 
v_2_TSS-i_TSS_Xs 
v_3_TSS-i_TSS_Xs 
v_4_TSSi_TSS_BM 
v_5_TSSi_TSS_BM 
v_6_TSSi_TSS_BM 
v_7_TSSi_TSS_BM 
v_9_TSSf_Xih*i_TSS_Xi + (1 - f_Xih)*i_TSS_Xs - i_TSS_BM 
v_10_TSS-Y_PO*3.23 + 0.6 
v_11_TSS3.23 - Y_PHA*0.6 
v_12_TSS3.23 - Y_PHA*0.6 
v_13_TSSi_TSS_BM - 0.6/Y_PAO 
v_14_TSSi_TSS_BM - 0.6/Y_PAO 
v_15_TSSf_Xip*i_TSS_Xi + (1 - f_Xip)*i_TSS_Xs - i_TSS_BM 
v_16_TSS-3.23 
v_17_TSS-0.6 
v_18_TSSi_TSS_BM 
v_19_TSSf_Xia*i_TSS_Xi + (1 - f_Xia)*i_TSS_Xs - i_TSS_BM 
v_13_O-(1 - Y_PAO)/Y_PAO 
K_h_T3.0Hydrolysis rate at T=20 deg C [d^-1]
eta_NO_Xs0.6Anoxic hydrolysis reduction factor [-]
eta_fe0.4Anaerobic hydrolysis reduction factor [-]
K_O_Xs0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xs0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_X0.1Saturation coefficient for particulate COD [g Xs/(g Xh)]
mu_H_T6.0Maximum growth rate on substrate at T=20 deg C [g Xs/(g Xh)/d]
rho_fe_T3.0Maximum rate for fermentation at T=20 deg C [g Sf/(g Xh)/d]
eta_NO_Xh0.8Reduction factor for denitrification [-]
b_H_T0.4Rate for lysis and decay at T=20 deg C [d^-1]
K_O_Xh0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_F4.0Saturation coefficient for growth on Sf [g COD/m3]
K_fe4.0Saturation coefficient for fermentation of Sf [g COD/m3]
K_A_Xh4.0Saturation coefficient for growth on acetate Sa [g COD/m3]
K_NO_Xh0.5Saturation/inhibition coefficient for nitrate [g N/m3]
K_NH_Xh0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_P_Xh0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xh0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
rho_PHA_T3.0Rate for storage of Xpha (base Xpp) at T=20 deg C [g Xpha/(g Xpao)/d]
rho_PP_T1.5Rate for storage of Xpp at T=20 deg C [g Xpp/(g Xpao)/d]
mu_PAO_T1.0Maximum growth rate of PAO at T=20 deg C [d^-1]
eta_NO_Xpao0.6Reduction factor for anoxic activity [-]
b_PAO_T0.2Rate for lysis of Xpao at T=20 deg C [d^-1]
b_PP_T0.2Rate for lysis of Xpp at T=20 dedg C [d^-1]
b_PHA_T0.2Rate for lysis of Xpha at T=20 deg C [d^-1]
K_O_Xpao0.2Saturation/inhibition coefficient for oxygen [g O2/m3]
K_NO_Xpao0.5Saturation coefficient for nitrate, Sno3 [g N/m3]
K_A_Xpao4.0Saturation coefficient for acetate, Sa [g COD/m3]
K_NH_Xpao0.05Saturation coefficient for ammonium (nutrient) [g N/m3]
K_PS0.2Saturation coefficient for phosphorus in storage of PP [g P/m3]
K_P_Xpao0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
K_ALK_Xpao0.1Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_PP0.01Saturation coefficient for poly-phosphate [g Xpp/(g Xpao)]
K_MAX0.34Maximum ratio of Xpp/Xpao [g Xpp/(g Xpao)]
K_IPP0.02Inhibition coefficient for PP storage [g Xpp/(g Xpao)]
K_PHA0.01Saturation coefficient for PHA [g Xpha/(g Xpao)]
mu_AUT_T1.0Maximum growth rate of Xa at T=20 deg C [d^-1]
b_AUT_T0.15Decay rate of Xa at T=20 deg C [d^-1]
K_O_Xa0.5Saturation coefficient for oxygen [g O2/m3]
K_NH_Xa1.0Saturation coefficient for ammonium (substrate) [g N/m3]
K_ALK_Xa0.5Saturation coefficient for alkalinity (HCO3) [mole HCO3/m3]
K_P_Xa0.01Saturation coefficient for phosphate (nutrient) [g P/m3]
k_PRE1.0Rate constant for P precipitation [m3/(g Fe(OH3))/d]
k_RED0.6Rate constant for redissolution [d^-1]
K_ALK_Pre0.5Saturation coefficient for alkalinity [mole HCO3/m3]
V50Volume of precipitation tank [m3]
Wsub2.5effective substance in precipitant [mol/kg]
D1.4density of precipitant [kg/l]
beta5.0precipitant surplus
Qmin5.0Minimum flow of precipitant [l/h]
MP30.97Molar Mass of Phosphorus [g/mol]
Mpre55.85Molar Mass of precipitant [g/mol]

Modelica definition

model precipitation "Phosphorus precipitation tank" 
  
  extends WasteWater.Icons.precipitation;
  extends Interfaces.ASM2dbase;
  
  parameter Modelica.SIunits.Volume V=50 "Volume of precipitation tank";
  parameter Real Wsub=2.5 "effective substance in precipitant [mol/kg]";
  parameter Real D=1.4 "density of precipitant [kg/l]";
  parameter Real beta=5.0 "precipitant surplus";
  parameter Real Qmin=5.0 "Minimum flow of precipitant [l/h]";
  parameter Real MP=30.97 "Molar Mass of Phosphorus [g/mol]";
  parameter Real Mpre=55.85 "Molar Mass of precipitant [g/mol]";
  WWU.VolumeFlowRate Qpreci "Dosage flow of precipitant used";
  Real Preci "Concentration of effective substance in precipitant flow
  [g/m³]";
  Real H;

  // following 4 connectors are already in ASM2dbase and are inherited,
  // but listed hear again to avoid an icon related problem
  // with the sequence of extends-clauses
    Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out;
  Interfaces.WWFlowAsm2dout MeasurePort;
  Modelica.Blocks.Interfaces.InPort T(final n=1);
equation 
  
  aeration = 0;
  //no aerotation in this tank
  
  H = (1/Wsub)*(1/(D*1000))*(1/Mpre)*Mpre/MP*beta*In.Spo*In.Q;
  Qpreci = if H < (Qmin*24/1000) then Qmin*24/1000 else H;
  // the factor 1.91 is a stoichiometric coefficient between Fe3+ and Xmeoh
  Preci = 1.91*Wsub*D*Mpre*1000;
  
  // volume dependent dilution term of each concentration  
  inputSo = (In.So - So)*In.Q/V;
  inputSf = (In.Sf - Sf)*In.Q/V;
  inputSa = (In.Sa - Sa)*In.Q/V;
  inputSnh = (In.Snh - Snh)*In.Q/V;
  inputSno = (In.Sno - Sno)*In.Q/V;
  inputSpo = (In.Spo - Spo)*In.Q/V;
  inputSi = (In.Si - Si)*In.Q/V;
  inputSalk = (In.Salk - Salk)*In.Q/V;
  inputSn2 = (In.Sn2 - Sn2)*In.Q/V;
  inputXi = (In.Xi - Xi)*In.Q/V;
  inputXs = (In.Xs - Xs)*In.Q/V;
  inputXh = (In.Xh - Xh)*In.Q/V;
  inputXpao = (In.Xpao - Xpao)*In.Q/V;
  inputXpp = (In.Xpp - Xpp)*In.Q/V;
  inputXpha = (In.Xpha - Xpha)*In.Q/V;
  inputXa = (In.Xa - Xa)*In.Q/V;
  inputXtss = (In.Xtss - Xtss)*In.Q/V;
  inputXmeoh = (In.Xmeoh - Xmeoh)*In.Q/V + Qpreci*Preci/V;
  inputXmep = (In.Xmep - Xmep)*In.Q/V;
  
end precipitation;

WasteWater.ASM2d.SecClarModTakacs WasteWater.ASM2d.SecClarModTakacs

ASM2d Secondary Clarifier Model based on Takacs

WasteWater.ASM2d.SecClarModTakacs

Information

This component models an ASM2d 10 - layer secondary clarifier model with 4 layers 
above the  feed_layer (including top_layer) and 5 layers below the feed_layer 
(including bottom_layer) based on Takacs` theory.

Parameters

NameDefaultDescription
hsc4.0height of secondary clarifier [m]
n10number of layers of SC model
zmhsc/(1.0*n)height of m-th secondary clarifier layer [m]
Asc1500.0area of secondary clarifier [m2]
Xt3000.0threshold for X [mg/l]

Modelica definition

model SecClarModTakacs 
  "ASM2d Secondary Clarifier Model based on Takacs" 
  
  extends WasteWater.Icons.SecClar;
  extends ASM2d.SecClar.Takacs.Interfaces.ratios;
  package SCP = ASM2d.SecClar.Takacs;
  package SI = Modelica.SIunits;
  package WI = ASM2d.Interfaces;
  package WWU = WasteWater.WasteWaterUnits;
  
  parameter SI.Length hsc=4.0 "height of secondary clarifier";
  parameter Integer n=10 "number of layers of SC model";
  parameter SI.Length zm=hsc/(1.0*n) "height of m-th secondary clarifier layer";
  parameter SI.Area Asc=1500.0 "area of secondary clarifier";
  parameter WWU.MassConcentration Xt=3000.0 "threshold for X";
  
  // total sludge concentration in clarifier feed
  WWU.MassConcentration Xf;
  WI.WWFlowAsm2din Feed;
  WI.WWFlowAsm2dout Effluent;
  WI.WWFlowAsm2dout Return;
  WI.WWFlowAsm2dout Waste;
  
  // layers 1 to 10
  SCP.bottom_layer S1(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf, 
    rXi=rXi, 
    rXs=rXs, 
    rXh=rXh, 
    rXpao=rXpao, 
    rXpp=rXpp, 
    rXpha=rXpha, 
    rXa=rXa, 
    rXmeoh=rXmeoh, 
    rXmep=rXmep);
  SCP.lower_layer S2(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf);
  SCP.lower_layer S3(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf);
  SCP.lower_layer S4(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf);
  SCP.lower_layer S5(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf);
  SCP.feed_layer S6(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf);
  SCP.upper_layer S7(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf, 
    Xt=Xt);
  SCP.upper_layer S8(
    zm=zm, 
    Asc=Asc, 
    Xt=Xt, 
    Xf=Xf);
  SCP.upper_layer S9(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf, 
    Xt=Xt);
  SCP.top_layer S10(
    zm=zm, 
    Asc=Asc, 
    Xf=Xf, 
    Xt=Xt, 
    rXi=rXi, 
    rXs=rXs, 
    rXh=rXh, 
    rXpao=rXpao, 
    rXpp=rXpp, 
    rXpha=rXpha, 
    rXa=rXa, 
    rXmeoh=rXmeoh, 
    rXmep=rXmep);
equation 
  
  connect(S1.Up, S2.Dn);
  connect(S2.Up, S3.Dn);
  connect(S3.Up, S4.Dn);
  connect(S5.Up, S6.Dn);
  connect(S6.Up, S7.Dn);
  connect(S7.Up, S8.Dn);
  connect(S9.Up, S10.Dn);
  connect(S4.Up, S5.Dn);
  connect(S8.Up, S9.Dn);
  connect(Feed, S6.In);
  connect(S1.PQw, Waste);
  connect(S10.Out, Effluent);
  connect(S1.PQr, Return);
  
  // total sludge concentration in clarifier feed
  Xf = Feed.Xtss;
  
  // ratios of solid components
  rXi = Feed.Xi/Xf;
  rXs = Feed.Xs/Xf;
  rXh = Feed.Xh/Xf;
  rXpao = Feed.Xpao/Xf;
  rXpp = Feed.Xpp/Xf;
  rXpha = Feed.Xpha/Xf;
  rXa = Feed.Xa/Xf;
  rXmeoh = Feed.Xmeoh/Xf;
  rXmep = Feed.Xmep/Xf;
  
end SecClarModTakacs;

WasteWater.ASM2d.blower WasteWater.ASM2d.blower

Blower for the aeration of the nitrification tanks

WasteWater.ASM2d.blower

Information

This component models a blower of a wastewater treatment plant which generates
an airflow that is needed for the nitrification.

The blower is connected to the nitrification tank.

The airflow is controlled by a signal u (-1 <= u <= 1).

Parameters

NameDefaultDescription
Q_max20000maximum blower capacity [m3 Air/d], this is produced when the control signal u is 1 or greater
Q_min0.0minimum blower capacity [m3 Air/d], this is produced when the control signal u is -1 or below

Modelica definition

model blower "Blower for the aeration of the nitrification tanks" 
  
  package WWU = WasteWater.WasteWaterUnits;
  extends WasteWater.Icons.blower;
  
  parameter WWU.VolumeFlowRate Q_max=20000 "maximum blower capacity";
  parameter WWU.VolumeFlowRate Q_min=0.0 "minimum blower capacity";
  Real H; // this is just a help variable to reduce expressions
  
  Interfaces.AirFlow AirOut;
  Modelica.Blocks.Interfaces.InPort u(final n=1);
equation 
  
  H = 0.5*(-Q_min + Q_max) + u.signal[1]*0.5*(-Q_min + Q_max) + Q_min;
  AirOut.Q_air = -(if H > Q_max then Q_max else if H < Q_min then Q_min else H);
  
end blower;

WasteWater.ASM2d.pump WasteWater.ASM2d.pump

ASM2d wastewater pump

WasteWater.ASM2d.pump

Information

This component models an ASM2d wastewater pump. It generates a wastewater flow
that is controlled by the signal u (-1 <= u <=1).

Parameters

NameDefaultDescription
Q_min0.0minimum pump capacity [m3/d], this is produced when the control signal u is -1 or below
Q_max20000maximum pump capacity [m3/d], this is produced when the control signal u is 1 or greater

Modelica definition

model pump "ASM2d wastewater pump" 
  
  package WWU = WasteWater.WasteWaterUnits;
  extends WasteWater.Icons.pump;
  
  parameter WWU.VolumeFlowRate Q_min=0.0 "minimum pump capacity";
  parameter WWU.VolumeFlowRate Q_max=20000 "maximum pump capacity";
  
  Real H;
  //help variable to reduce expressions
  
  Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out;
  Modelica.Blocks.Interfaces.InPort u(final n=1);
equation 
  
  H = 0.5*(-Q_min + Q_max) + u.signal[1]*0.5*(-Q_min + Q_max) + Q_min;
  
  Out.Q = -(if H > Q_max then Q_max else if H < Q_min then Q_min else H);
  Out.Q + In.Q = 0;
  
  Out.So = In.So;
  Out.Sf = In.Sf;
  Out.Sa = In.Sa;
  Out.Snh = In.Snh;
  Out.Sno = In.Sno;
  Out.Spo = In.Spo;
  Out.Si = In.Si;
  Out.Salk = In.Salk;
  Out.Sn2 = In.Sn2;
  Out.Xi = In.Xi;
  Out.Xs = In.Xs;
  Out.Xh = In.Xh;
  Out.Xpao = In.Xpao;
  Out.Xpp = In.Xpp;
  Out.Xpha = In.Xpha;
  Out.Xa = In.Xa;
  Out.Xtss = In.Xtss;
  Out.Xmeoh = In.Xmeoh;
  Out.Xmep = In.Xmep;
  
end pump;

WasteWater.ASM2d.FlowSource WasteWater.ASM2d.FlowSource

Flowsource

WasteWater.ASM2d.FlowSource

Information

This component is used to feed an ASM2d wwtp model with flow data from measurement
when e.g. concentration is measured after the primary clarifier.

The dimension of InPort is 1:

   1  volumeflowrate Q of incoming wastewater [m3/d]

Modelica definition

model FlowSource "Flowsource" 
  
  extends WasteWater.Icons.FlowSource;
  Interfaces.WWFlowAsm2dout Out;
  Modelica.Blocks.Interfaces.InPort data(final n=1);
equation 
  
  Out.Q = -data.signal[1];
  
end FlowSource;

WasteWater.ASM2d.WWSource WasteWater.ASM2d.WWSource

Wastewater source

WasteWater.ASM2d.WWSource

Information

This component provides all ASM2d data at the influent of a wastewater treatment plant.
The dimension of InPort is 19:

  1  volumeflowrate Q of incoming wastewater [m3/d]
  2  So   [g O2/m3]
  3  Sf   [g COD/m3]
  4  Sa   [g COD/m3]
  5  Snh  [g N/m3]
  6  Sno  [g N/m3]
  7  Spo  [g P/m3]
  8  Si   [g COD/m3]
  9  Salk [mmol/l]
 10 Sn2  [g N/m3]
 11 Xi   [g COD/m3]
 12 Xs   [g COD/m3]
 13 Xh   [g COD/m3]
 14 Xpao [g COD/m3]
 15 Xpp  [g P/m3]
 16 Xpha [g COD/m3]
 17 Xa   [g COD/m3]
 18 Xmeoh [g TSS/m3]
 19 Xmep [g TSS/m3]

Parameters

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]

Modelica definition

model WWSource "Wastewater source" 
  
  extends WasteWater.Icons.WWSource;
  extends ASM2d.Interfaces.conversion_factors;
  
  Interfaces.WWFlowAsm2dout Out;
  Modelica.Blocks.Interfaces.InPort data(final n=19);
equation 
  
  Out.Q = -data.signal[1];
  Out.So = data.signal[2];
  Out.Sf = data.signal[3];
  Out.Sa = data.signal[4];
  Out.Snh = data.signal[5];
  Out.Sno = data.signal[6];
  Out.Spo = data.signal[7];
  Out.Si = data.signal[8];
  Out.Salk = data.signal[9];
  Out.Sn2 = data.signal[10];
  Out.Xi = data.signal[11];
  Out.Xs = data.signal[12];
  Out.Xh = data.signal[13];
  Out.Xpao = data.signal[14];
  Out.Xpp = data.signal[15];
  Out.Xpha = data.signal[16];
  Out.Xa = data.signal[17];
  Out.Xtss = i_TSS_Xi*Out.Xi + i_TSS_Xs*Out.Xs + i_TSS_BM*(Out.Xh + Out.Xpao + 
    Out.Xa) + 3.23*Out.Xpp + 0.6*Out.Xpha + Out.Xmeoh + Out.Xmep;
  Out.Xmeoh = data.signal[18];
  Out.Xmep = data.signal[19];
  
end WWSource;

WasteWater.ASM2d.EffluentSink WasteWater.ASM2d.EffluentSink

Receiving water (river)

WasteWater.ASM2d.EffluentSink

Information

This component terminates an ASM2d wastewater treatment plant model 
e.g. the wastewater flow to the receiving water.

Modelica definition

model EffluentSink "Receiving water (river)" 
  // only for graphical termination in diagram layer, no equations needed
  
  extends WasteWater.Icons.EffluentSink;
  Interfaces.WWFlowAsm2din In;
equation 
  
end EffluentSink;

WasteWater.ASM2d.SludgeSink WasteWater.ASM2d.SludgeSink

Wastesludge sink

WasteWater.ASM2d.SludgeSink

Information

This component terminates the waste sludge stream of an ASM2d wastewater 
treatment plant model. Storage or further sludge treatment is not jet considered.

Modelica definition

model SludgeSink "Wastesludge sink" 
  // only for graphical termination in diagram layer, no equations needed
  
  extends WasteWater.Icons.SludgeSink;
  Interfaces.WWFlowAsm2din In;
equation 
  
end SludgeSink;

WasteWater.ASM2d.ControlledDivider2 WasteWater.ASM2d.ControlledDivider2

Controlled flow divider

WasteWater.ASM2d.ControlledDivider2

Information

This component divides one wastewater flow (ASM2d) into two flows which are controlled 
by the signal u (0...1). Is u.signal=1, the flow goes to output 1 (Out1) and is u.signal=0,
 the flow goes to output 2 (Out2).

The concentrations of the outport-flows are equal to the concentration at inport.

Modelica definition

model ControlledDivider2 "Controlled flow divider" 
  // divides one flow of wastewater into 2 Flows controlled by the  
  // input signal u; u=1 means Out1.Q=In.Q and u=0 means Out2.Q=In.Q

   extends WasteWater.Icons.ControlledDivider2;
  
  Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out1;
  Interfaces.WWFlowAsm2dout Out2;
  Modelica.Blocks.Interfaces.InPort u(final n=1);
equation 
  
  Out1.Q = -In.Q*u.signal[1];
  Out2.Q = -In.Q*(1 - u.signal[1]);
  
  Out1.So = In.So;
  Out1.Sf = In.Sf;
  Out1.Sa = In.Sa;
  Out1.Snh = In.Snh;
  Out1.Sno = In.Sno;
  Out1.Spo = In.Spo;
  Out1.Si = In.Si;
  Out1.Salk = In.Salk;
  Out1.Sn2 = In.Sn2;
  Out1.Xi = In.Xi;
  Out1.Xs = In.Xs;
  Out1.Xh = In.Xh;
  Out1.Xpao = In.Xpao;
  Out1.Xpp = In.Xpp;
  Out1.Xpha = In.Xpha;
  Out1.Xa = In.Xa;
  Out1.Xtss = In.Xtss;
  Out1.Xmeoh = In.Xmeoh;
  Out1.Xmep = In.Xmep;
  
  Out2.So = In.So;
  Out2.Sf = In.Sf;
  Out2.Sa = In.Sa;
  Out2.Snh = In.Snh;
  Out2.Sno = In.Sno;
  Out2.Spo = In.Spo;
  Out2.Si = In.Si;
  Out2.Salk = In.Salk;
  Out2.Sn2 = In.Sn2;
  Out2.Xi = In.Xi;
  Out2.Xs = In.Xs;
  Out2.Xh = In.Xh;
  Out2.Xpao = In.Xpao;
  Out2.Xpp = In.Xpp;
  Out2.Xpha = In.Xpha;
  Out2.Xa = In.Xa;
  Out2.Xtss = In.Xtss;
  Out2.Xmeoh = In.Xmeoh;
  Out2.Xmep = In.Xmep;
  
end ControlledDivider2;

WasteWater.ASM2d.divider2 WasteWater.ASM2d.divider2

Flowdivider

WasteWater.ASM2d.divider2

Information

This component divides one ASM2d wastewater flow into two ASM2d wastewater flows.

Modelica definition

model divider2 "Flowdivider"   
  // divides one flow of wastewater into 2 Flows; one amout needs to be specified
  
  extends WasteWater.Icons.divider2;
  Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out1;
  Interfaces.WWFlowAsm2dout Out2;
equation 
  
  In.Q + Out1.Q + Out2.Q = 0;
  
  Out1.So = In.So;
  Out1.Sf = In.Sf;
  Out1.Sa = In.Sa;
  Out1.Snh = In.Snh;
  Out1.Sno = In.Sno;
  Out1.Spo = In.Spo;
  Out1.Si = In.Si;
  Out1.Salk = In.Salk;
  Out1.Sn2 = In.Sn2;
  Out1.Xi = In.Xi;
  Out1.Xs = In.Xs;
  Out1.Xh = In.Xh;
  Out1.Xpao = In.Xpao;
  Out1.Xpp = In.Xpp;
  Out1.Xpha = In.Xpha;
  Out1.Xa = In.Xa;
  Out1.Xtss = In.Xtss;
  Out1.Xmeoh = In.Xmeoh;
  Out1.Xmep = In.Xmep;
  
  Out2.So = In.So;
  Out2.Sf = In.Sf;
  Out2.Sa = In.Sa;
  Out2.Snh = In.Snh;
  Out2.Sno = In.Sno;
  Out2.Spo = In.Spo;
  Out2.Si = In.Si;
  Out2.Salk = In.Salk;
  Out2.Sn2 = In.Sn2;
  Out2.Xi = In.Xi;
  Out2.Xs = In.Xs;
  Out2.Xh = In.Xh;
  Out2.Xpao = In.Xpao;
  Out2.Xpp = In.Xpp;
  Out2.Xpha = In.Xpha;
  Out2.Xa = In.Xa;
  Out2.Xtss = In.Xtss;
  Out2.Xmeoh = In.Xmeoh;
  Out2.Xmep = In.Xmep;
  
end divider2;

WasteWater.ASM2d.mixer2 WasteWater.ASM2d.mixer2

Mixer of two ASM2d characterised flows

WasteWater.ASM2d.mixer2

Information

This component mixes two flows of wastewater (ASM2d) of different concentration and different amount.

Modelica definition

model mixer2 "Mixer of two ASM2d characterised flows" 
  
  extends WasteWater.Icons.mixer2;
  Interfaces.WWFlowAsm2din In1;
  Interfaces.WWFlowAsm2din In2;
  Interfaces.WWFlowAsm2dout Out;
equation 
  
  In1.Q + In2.Q + Out.Q = 0;
  
  Out.So = (In1.So*In1.Q + In2.So*In2.Q)/(In1.Q + In2.Q);
  Out.Sf = (In1.Sf*In1.Q + In2.Sf*In2.Q)/(In1.Q + In2.Q);
  Out.Sa = (In1.Sa*In1.Q + In2.Sa*In2.Q)/(In1.Q + In2.Q);
  Out.Snh = (In1.Snh*In1.Q + In2.Snh*In2.Q)/(In1.Q + In2.Q);
  Out.Sno = (In1.Sno*In1.Q + In2.Sno*In2.Q)/(In1.Q + In2.Q);
  Out.Spo = (In1.Spo*In1.Q + In2.Spo*In2.Q)/(In1.Q + In2.Q);
  Out.Si = (In1.Si*In1.Q + In2.Si*In2.Q)/(In1.Q + In2.Q);
  Out.Salk = (In1.Salk*In1.Q + In2.Salk*In2.Q)/(In1.Q + In2.Q);
  Out.Sn2 = (In1.Sn2*In1.Q + In2.Sn2*In2.Q)/(In1.Q + In2.Q);
  Out.Xi = (In1.Xi*In1.Q + In2.Xi*In2.Q)/(In1.Q + In2.Q);
  Out.Xs = (In1.Xs*In1.Q + In2.Xs*In2.Q)/(In1.Q + In2.Q);
  Out.Xh = (In1.Xh*In1.Q + In2.Xh*In2.Q)/(In1.Q + In2.Q);
  Out.Xpao = (In1.Xpao*In1.Q + In2.Xpao*In2.Q)/(In1.Q + In2.Q);
  Out.Xpp = (In1.Xpp*In1.Q + In2.Xpp*In2.Q)/(In1.Q + In2.Q);
  Out.Xpha = (In1.Xpha*In1.Q + In2.Xpha*In2.Q)/(In1.Q + In2.Q);
  Out.Xa = (In1.Xa*In1.Q + In2.Xa*In2.Q)/(In1.Q + In2.Q);
  Out.Xtss = (In1.Xtss*In1.Q + In2.Xtss*In2.Q)/(In1.Q + In2.Q);
  Out.Xmeoh = (In1.Xmeoh*In1.Q + In2.Xmeoh*In2.Q)/(In1.Q + In2.Q);
  Out.Xmep = (In1.Xmep*In1.Q + In2.Xmep*In2.Q)/(In1.Q + In2.Q);
  
end mixer2;

WasteWater.ASM2d.mixer3 WasteWater.ASM2d.mixer3

Mixer of 3 ASM2d characterised flows

WasteWater.ASM2d.mixer3

Information

This component mixes 3 flows of wastewater (ASM2d) of different concentration and different amount.

Modelica definition

model mixer3 "Mixer of 3 ASM2d characterised flows" 
  
  extends WasteWater.Icons.mixer3;
  Interfaces.WWFlowAsm2din In1;
  Interfaces.WWFlowAsm2din In2;
  Interfaces.WWFlowAsm2din In3;
  Interfaces.WWFlowAsm2dout Out;
equation 
  
  In1.Q + In2.Q + In3.Q + Out.Q = 0;
  Out.So = (In1.So*In1.Q + In2.So*In2.Q + In3.So*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Sf = (In1.Sf*In1.Q + In2.Sf*In2.Q + In3.Sf*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Sa = (In1.Sa*In1.Q + In2.Sa*In2.Q + In3.Sa*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Snh = (In1.Snh*In1.Q + In2.Snh*In2.Q + In3.Snh*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Sno = (In1.Sno*In1.Q + In2.Sno*In2.Q + In3.Sno*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Spo = (In1.Spo*In1.Q + In2.Spo*In2.Q + In3.Spo*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Si = (In1.Si*In1.Q + In2.Si*In2.Q + In3.Si*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Salk = (In1.Salk*In1.Q + In2.Salk*In2.Q + In3.Salk*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Sn2 = (In1.Sn2*In1.Q + In2.Sn2*In2.Q + In3.Sn2*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xi = (In1.Xi*In1.Q + In2.Xi*In2.Q + In3.Xi*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xs = (In1.Xs*In1.Q + In2.Xs*In2.Q + In3.Xs*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xh = (In1.Xh*In1.Q + In2.Xh*In2.Q + In3.Xh*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xpao = (In1.Xpao*In1.Q + In2.Xpao*In2.Q + In3.Xpao*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xpp = (In1.Xpp*In1.Q + In2.Xpp*In2.Q + In3.Xpp*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xpha = (In1.Xpha*In1.Q + In2.Xpha*In2.Q + In3.Xpha*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xa = (In1.Xa*In1.Q + In2.Xa*In2.Q + In3.Xa*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xtss = (In1.Xtss*In1.Q + In2.Xtss*In2.Q + In3.Xtss*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xmeoh = (In1.Xmeoh*In1.Q + In2.Xmeoh*In2.Q + In3.Xmeoh*In3.Q)/(In1.Q + In2.Q + In3.Q);
  Out.Xmep = (In1.Xmep*In1.Q + In2.Xmep*In2.Q + In3.Xmep*In3.Q)/(In1.Q + In2.Q + In3.Q);
  
end mixer3;

WasteWater.ASM2d.sensor_COD WasteWater.ASM2d.sensor_COD

Ideal sensor to measure chemical oxygen demand (COD)

WasteWater.ASM2d.sensor_COD

Information

This component measures the chemical oxygen demand (COD) concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be further 
processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_COD 
  "Ideal sensor to measure chemical oxygen demand (COD)" 
  
  extends WasteWater.Icons.sensor_COD;
  
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort COD(final n=1);
equation 
  
  In.Q = 0.0;
  COD.signal[1] = In.Sf + In.Sa + In.Si + In.Xi + In.Xs + In.Xh + In.Xpao + In.
    Xpha + In.Xa;
  
end sensor_COD;

WasteWater.ASM2d.sensor_NH WasteWater.ASM2d.sensor_NH

Ideal sensor to measure ammonium nitrogen

WasteWater.ASM2d.sensor_NH

Information

This component measures the ammonium nitrogen concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_NH "Ideal sensor to measure ammonium nitrogen" 
  
  extends WasteWater.Icons.sensor_NH;
  
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort Snh(final n=1);
equation 
  
  In.Q = 0;
  Snh.signal[1] = In.Snh;
  
end sensor_NH;

WasteWater.ASM2d.sensor_NO WasteWater.ASM2d.sensor_NO

Ideal sensor to measure nitrate nitrogen

WasteWater.ASM2d.sensor_NO

Information

This component measures the nitrate nitrogen concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_NO "Ideal sensor to measure nitrate nitrogen" 
  
  extends WasteWater.Icons.sensor_NO;
  
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort Sno(final n=1);
equation 
  
  In.Q = 0;
  Sno.signal[1] = In.Sno;
  
end sensor_NO;

WasteWater.ASM2d.sensor_O2 WasteWater.ASM2d.sensor_O2

Ideal sensor to measure dissolved oxygen concentration

WasteWater.ASM2d.sensor_O2

Information

This component measures the dissolved oxygen concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_O2 
  "Ideal sensor to measure dissolved oxygen concentration" 
  
  extends WasteWater.Icons.sensor_O2;
  
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort So(final n=1);
equation 
  
  In.Q = 0;
  So.signal[1] = In.So;
  
end sensor_O2;

WasteWater.ASM2d.sensor_PO WasteWater.ASM2d.sensor_PO

Ideal sensor to measure dissolved phosphorus

WasteWater.ASM2d.sensor_PO

Information

This component measures the dissolves phosphorus concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_PO "Ideal sensor to measure dissolved phosphorus" 
  
  extends WasteWater.Icons.sensor_PO;
  
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort Spo(final n=1);
equation 
  
  In.Q = 0;
  Spo.signal[1] = In.Spo;
  
end sensor_PO;

WasteWater.ASM2d.sensor_Q WasteWater.ASM2d.sensor_Q

Ideal sensor to measure the flow rate of an ASM2d wastewater stream

WasteWater.ASM2d.sensor_Q

Information

This component measures the flow of an ASM2d wastewater stream and provides
the result as output signal (to be further processed with blocks of
the Modelica.Blocks library).

Modelica definition

model sensor_Q 
  "Ideal sensor to measure the flow rate of an ASM2d wastewater stream"
   
  
  extends WasteWater.Icons.sensor_Q;
  
  Interfaces.WWFlowAsm2din In;
  Interfaces.WWFlowAsm2dout Out;
  Modelica.Blocks.Interfaces.OutPort Q(final n=1);
equation 
  
  In.Q + Out.Q = 0;
  Q.signal[1] = In.Q;
  // eventually abs(In.Q) to be shure to have pos. signal
  In.So = Out.So;
  In.Sf = Out.Sf;
  In.Sa = Out.Sa;
  In.Snh = Out.Snh;
  In.Sno = Out.Sno;
  In.Spo = Out.Spo;
  In.Si = Out.Si;
  In.Salk = Out.Salk;
  In.Sn2 = Out.Sn2;
  In.Xi = Out.Xi;
  In.Xs = Out.Xs;
  In.Xh = Out.Xh;
  In.Xpao = Out.Xpao;
  In.Xpp = Out.Xpp;
  In.Xpha = Out.Xpha;
  In.Xa = Out.Xa;
  In.Xtss = Out.Xtss;
  In.Xmeoh = Out.Xmeoh;
  In.Xmep = Out.Xmep;
  
end sensor_Q;

WasteWater.ASM2d.sensor_TKN WasteWater.ASM2d.sensor_TKN

Ideal TKN and total nitrogen sensor

WasteWater.ASM2d.sensor_TKN

Information

This component measures the Total Kjeldal Nitrogen (TKN) and the total nitrogen (N_total)
concentration [g/m3] of ASM2d wastewater and provides the result as output signal
(to be further processed with blocks of the Modelica.Blocks library).

signal[1] - TKN
signal[2] - N_total

Parameters

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]

Modelica definition

model sensor_TKN "Ideal TKN and total nitrogen sensor" 
  
  extends WasteWater.Icons.sensor_TKN;
  extends Interfaces.conversion_factors;
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort TKN(final n=2);
equation 
  
  In.Q = 0.0;
  TKN.signal[1] = In.Snh + i_N_Si*In.Si + i_N_Sf*In.Sf + i_N_Xi*In.Xi
                     + i_N_Xs*In.Xs + i_N_BM*(In.Xh + In.Xpao + In.Xa);
  TKN.signal[2] = TKN.signal[1] + In.Sno;
  
end sensor_TKN;

WasteWater.ASM2d.sensor_TP WasteWater.ASM2d.sensor_TP

Ideal sensor to measure the total phosphorus concentration in ASM2d wastewater

WasteWater.ASM2d.sensor_TP

Information

This component measures the total phosphorus concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Parameters

NameDefaultDescription
i_N_Si0.01N content of inert soluble COD Si [gN/gCOD]
i_N_Sf0.03N content of fermentable substrates Sf [gN/gCOD]
i_N_Xi0.02N content of inert particulate COD Xi [gN/gCOD]
i_N_Xs0.04N content of slowly biodegradable substrate Xs [gN/gCOD]
i_N_BM0.07N content of biomass, Xh, Xpao, Xa [gN/gCOD]
i_P_Si0.0P content of inert soluble COD Si [gP/gCOD]
i_P_Sf0.01P content of fermentable substrates Sf [gP/gCOD]
i_P_Xi0.01P content of inert particulate COD Xi [gP/gCOD]
i_P_Xs0.01P content of slowly biodegradable substrate Xs [gP/gCOD]
i_P_BM0.02P content of biomass, Xh, Xpao, Xa [gP/gCOD]
i_TSS_Xi0.75TSS to COD ratio for Xi [gTSS/gCOD]
i_TSS_Xs0.75TSS to COD ratio for Xs [gTSS/gCOD]
i_TSS_BM0.9TSS to COD ratio for biomass, Xh, Xpao, Xa [gTSS/gCOD]

Modelica definition

model sensor_TP 
  "Ideal sensor to measure the total phosphorus concentration in ASM2d wastewater"
   
  
  extends WasteWater.Icons.sensor_TP;
  extends Interfaces.conversion_factors;
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort TP(final n=1);
equation 
  
  In.Q = 0.0;
  TP.signal[1] = In.Spo + In.Xpp + i_P_Sf*In.Sf + i_P_Si*In.Si + i_P_Xi*In.Xi
     + i_P_Xs*In.Xs + i_P_BM*(In.Xh + In.Xa + In.Xpao) + In.Xmep/4.87;
  
end sensor_TP;

WasteWater.ASM2d.sensor_TSS WasteWater.ASM2d.sensor_TSS

Ideal sensor to measure total suspended solids concentration (ASM2d)

WasteWater.ASM2d.sensor_TSS

Information

This component measures the total suspended solids concentration [g/m3]
of ASM2d wastewater and provides the result as output signal (to be
further processed with blocks of the Modelica.Blocks library).

Modelica definition

model sensor_TSS 
  "Ideal sensor to measure total suspended solids concentration (ASM2d)"
   
  
  extends WasteWater.Icons.sensor_TSS;
  Interfaces.WWFlowAsm2din In;
  Modelica.Blocks.Interfaces.OutPort TSS(final n=1);
equation 
  
  In.Q = 0;
  TSS.signal[1] = In.Xtss;
  
end sensor_TSS;

HTML-documentation generated by Dymola Mon Aug 18 11:14:42 2003 .