We're currently working on developing an MSX model for Chlorine Decay that can account for wall decay as a factor of Biofilm growth (thus removing the need to specify wall decay for specific pipes throughout the network).
Unfortunately the equation for this relies on the mass transfer coefficient, which is dependent on the type of flow, as explained here: https://docs.bentley.com/LiveContent/web/Bentley%20WaterGEMS%20SS6-v1/en/GUID-D7D70292-50F6-4066-A30E-3B98BBB2BF7B.html.
This is built into the WaterGEMS standard pipe wall reaction calculations, however I need to know whether we can reference this coefficient in MSX, does anyone know whether this is possible? My understanding is that EPANET is capable of this so I assume WaterGEMS is capable as well, I just don’t know how.
For anyone wondering, the equations for Bulk decay are very simple. Below is a copy of what we use currently (no wall decay):
The Wall Decay equations are derived as follows (A&B are constants to be determined by trial and error, kw is what we need from WaterGEMS)
You would need access to the WaterObjects.NET functionality to use the "Mass Transfer Coefficient" used in the first order wall reaction rate.
Another approach would be to use Formula Based User Defined Extensions. From the formula provided develop an equation to calculate the mass transfer coefficient from the equations given. However, that would first require classification of flow based on Reynold's number.
You can develop an formula based UDX for Reynold's number and classify the flow as laminar or turbulent; then develop separate equations (using formula based UDX) for both the type of flows for the Sherwood number. It is best in this case that you create two separate selection sets for both the type of flows and work on them individually.
Once you have the Sherwood number values for both the flow use the equation to calculate mass transfer coefficient again using the formula based UDX.
This procedure is a bit complicated, but can be achieved.
Let me know if this helps.
Bentley Technical Support
Thank you for your assistance. I have absolutely no programming knowledge so I'm afraid that first suggestion is not an option.
Unfortunately I'm only a Civil engineer so my knowledge of the chemical reactions and their associated equations behind them is very limited. In order to be able to follow your workaround I need the following knowledge.
This would be a lot easier if WaterGEMS could simply calculate the mass transfer coefficient for me (as I assume it does this already for first order wall decay calculations).
Alright, I have actually managed to find equations for Sherwood's number for both laminar and turbulent flow. As well as how this fits into into the Mass Transfer equation using information I found in the following paper by Risala A.Mohammed and Kifah M. Khudia: http://files.engineering.com/download.aspx?folder=a63c406b-103d-43d8-85bd-cf947370fb71&file=iasj.pdf (relevant information screenshotted below)
Yashodhan, if you could explain what you mean by 'selections sets' and how I can get the MSX code to differentiate between turbulent and laminar flow I should be onto a winner!
Did you see my earlier response?
I did see your earlier response and I'm well aware of the user guide and it's contents. The mass transfer coefficient equation you provided has the wrong constants for Chlorine in water and doesn't allow for variations in temperature. Additionally it doesn't allow for the changes in the coefficient that occur between laminar and turbulent flows.
The equation I provided is just a sample equation. You can choose whatever constants you like. In fact you have complete control over the full definition of any terms that you want/need.
With regards to "Additionally it doesn't allow for the changes in the coefficient that occur between laminar and turbulent flows." - Isn't that what Reynolds number is for? If not, can you please explain to me what is missing?
With regards to factoring in temperature, I guess you could model that as another species, though it sounds like a pretty challenging thing to attempt. Most people would just assume a constant temperature, is my guess.
In the screenshot in my above reply you'll see that the equation for Sherwoods number is different depending whether it's laminar or turbulent flow. This then means the equation for the Mass transfer coefficient is different whether it's laminar or turbulent flow. Which makes sense when you consider the difference in water flow patters between laminar and turbulent.
Temperature would be constant yes, but we do model for different temperatures at different times of the year. It would be preferable to have MSX coded so that we can enter temperature (in degrees Celsius) and it automatically calculates the constants for that temperature.
The tricky part, which I don't know how to solve at the moment. Is how to code the equations into MSX so that it recognizes the difference between laminar and turbulent flows and applies the variations in coefficients accordingly.
Likewise with Yashodhans UDX proposal, if I do work with the selection set issue, I also do not know how (or even if it's possible) to reference the UDX calculated values back into the MSX. Is MSX capable of that?
No it's not possible to use UDX with MSX in that way.
I guess I am confused as to why you are rejecting my answer as I am confident it provides you everything you need.
Let me know if there is anything I can clarify.
If you can explain how, within MSX, I can get it to apply different equations for mass transfer coefficient depending on whether the flow is laminar or turbulent, then that will provide me with the information I need.
You're answer doesn't provide that information, or any information that isn't already in the user guide.
If I could assume all flows in the system were turbulent at all times it wouldn't be a problem, I could use the one equation for Mass transfer and bobs-your-uncle it's done. But because large parts of the system will be under laminar flow conditions during night time when there's little demand I can't do this.
Here's a screenshot from a Bentley connect help page:
Now I just need the ability to apply these two different equations, depending on flow conditions, into MSX..
Or be able to directly reference the mass transfer coefficient (as calculated by watergems) into MSX