Posted Thu, 18 Dec 2014 11:42:47 GMT by Hector Jose Gosalbez Ingeniero Químico
Hi
How I can properly modeling a SBR reactor if I desire to remove nitrogen through different phases (anoxic-oxic,…)?

The difficulty that I find in that situation is that the “fill phase” is the only moment when the water enters to the tank, so, with that premise, a for example 7 reaction phases submodel where I can alternate anoxi-oxic-anoxic…. phases, it is not possible to add raw water to the tank during that “Reaction phase” and therefore my system is something like a N-D system (if we supposed that we introduce oxygen during the fill phase) instead a D-N system, which should be the right way to eliminate Nitrogen.

In brief, my problem is that I cannot add raw water to the SBR during the alternation of the different “reaction phases”.  How have you solved this “inconvenient” ? Maybe I am wrong in something?

Thanks a lot for your time

Héctor
Posted Thu, 18 Dec 2014 13:48:35 GMT by Enrico Remigi WEST Product Owner
The only option you have is to create your own variant of the base SBR model of WEST.
The [b]key-equation[/b] you will need to modify is the one that implements the by-pass flow.
And thank to the hierarchical structure of the WEST library, you are to do this only in one place: a base class called [b]SBRPointsettler[/b] that all the individual SBR models inherit from.

At around line 190 of the wwtp.base.SBR.msl, you find the implementation of [b]state.Q_Bypass[/b].
For the standard SBR models, the by-pass is active (and equals Q_In) in all phases, but the fill phase (T1).
All you need to do, to allow feed in other phases, is to [b]turn off (= 0) Q_Bypass in those phases[/b].
For instance:
[code]
state.Q_Bypass = IF (independent.t < interface.T_Launch) THEN 0.0
  ELSE IF (independent.t - state.t_Begin < interface.T1) THEN 0.0
    ELSE  IF (independent.t - state.t_Begin < (interface.T1 + state.T2)) THEN 0.0
      ELSE IF (independent.t - state.t_Begin < (interface.T1 + state.T2 + interface.T3)) THEN state.Q_In
        ELSE IF (independent.t - state.t_Begin < (interface.T1 + state.T2 + interface.T3 + interface.T4)) THEN state.Q_In
          ELSE state.Q_In ;
[/code]
will allow feed during both fill- and reaction (T2) phase.
Posted Thu, 18 Dec 2014 16:37:56 GMT by Hector Jose Gosalbez Ingeniero Químico
You are absolutely right. I have found the different files that you have mentioned and have identified the lines to change.
The only doubt that now arises is, in case of having WESTforDESIGN, is it possible to create this variation of the SBR model and conserve at the same time the original SBR model? I am not sure if with WESTforDESIGN allows creating new blocks…..

Thanks for your time.
Posted Thu, 18 Dec 2014 17:45:02 GMT by Enrico Remigi WEST Product Owner
We need to make a distinction here.
With a [b]WfDESIGN[/b] license the [b]Model Editor[/b] is not accessible. One could however modify (or even add) models, using a text editor. I would evidently not encourage this, because chances of making all kind of mistakes this way are endless ...
The Model Editor (accessible with [b]WfOPTIMIZATION[/b]) is a dedicated environment with all kind of support for editing models.

The other part of your question is also very relevant.
Indeed I would always recommend to [u]create variants of standard models[/u], rather than altering them with the risk of affecting other projects/models.
In your case, I would proceed as follows:
[list type=decimal]
[li]make a copy of the base class "SBRPointSettler" and call it e.g. "SBRPointSettler_ContinuousFeed"[/li]
[li]modify the relevant equation(s) in the new class[/li]
[li]now, make a copy of the base class "SBRPointsettler1PhaseReact" and call it e.g. "SBRPointsettler1PhaseReact_ContinuousFeed"[/li]
[li]I assume you can leave the original implementation, except for the class that it inherits from:[/li]
[/list]
Instead of:
[code]EXTENDS SBRPointsettler WITH[/code]

you will have:
[code]EXTENDS SBRPointSettler_ContinuousFeed WITH[/code]

One last remark: also take a look at the [b]CFCD[/b] (continuous flow & continuous decanting) and [b]CFID[/b] (continuous flow & intermittent decanting) models. I don't think they are ideal for your situation, but worth exploring.
Posted Mon, 05 Jan 2015 14:37:39 GMT by Youri Amerlinck
You should check out the CFCD model. It provides a SBR like sequence but allows flow entering the tank at any point in time.
Posted Thu, 26 Feb 2015 12:34:35 GMT by Hector Jose Gosalbez Ingeniero Químico
Hello,

Following your indications, I modified and renamed the two files you mentioned in order to turn off (= 0) Q_Bypass during the reaction phase:

• wwtp.base.SBR.sbrpointsettler1phasereact_ContinuousFeed
• wwtp.base.SBR_ContinuousFeed

I understood that the file named ”wwtp.base.SBR_ContinuousFeed” should be copied in the folder  named “MODEL” and the “wwtp.base.SBR.sbrpointsettler1phasereact_ContinuousFeed” file should be copied in the folder named (MODEL/SBR). Is it right? If it is, I do not know why, after doing that, when I open a West project and use a SBR block, it does not appear in “Properties/Genral/ClassName” the possibility to select the “SBR.sbrpointsettler1phasereact_ContinuousFeed”.
I would appreciate your indications to solve this problem if it is possible.

Thank you very much.
Posted Fri, 27 Feb 2015 08:47:06 GMT by Enrico Remigi WEST Product Owner
This is tricky, as I don't have a clear view of your file and class structure.
However, if you followed my instructions, word-by-word (he he) you should have:[list]
[li]a [b]new CLASS[/b], SBRPointSettler_ContinuousFeed, in the "wwtp.base.SBR.msl" file - I would guess at the bottom, immediately above the set of #include statements. Anyway, what matters is that it's written in this file and therefore "visible" by the rest of the library[/li]
[li]a [b]new file[/b], "wwtp.SBRPointsettler1PhaseReact_ContinuousFeed.msl" which contain 1 CLASS by the same name (i.e. SBRPointsettler1PhaseReact_ContinuousFeed) which, unlike the previous one, is associated to the icon "sbr" - this is what makes the ClassName appear in the drop-down in the WEST Properties pane[/li]
[/list]

Now, what's missing is that the rest of the library cannot "see" the new class, because the new file has not been included in its hierarchical structure.

Add the following statement to the "wwtp.base.SBR.msl" file, right at the end, after #include "SBR/wwtp.base.SBR.sbrpointsettler8phasereact.msl":
[code]#include "SBR/wwtp.base.SBR.sbrpointsettler1phasereact_ContinuousFeed"[/code]

You must be signed in to post in this forum.