The WaterObjects.NET SDK samples has a tool NPSH Calculator which calculates the in-memory results. How can the tool be modified to incorporate FILE BASED storage, so that the results are available across session?
Devashri, There is no longer a need to use the WaterObjects tool to calculate NPSH. The WaterGEMS/CAD solver automatically calculates the NPSH (available). If you have entered an NPSH (required) curve in Pump Definitions, it will also calculate NPSH (required) at that flow rate.
Related article: Calculating Net Positive Suction Head (NPSH)
I know that. But actually I have developed a tool on the lines of NPSH Calculator and in that I want to save the calculated results to file system, so that they are available across sessions. So if I get to know the modifications for changing IN-MEMORY results to FILE-BASED results in NPSH Calculator tool, I can incorporate it in my tool by adopting same approach.
Devashri, can you tell us a bit more about what you need to do with the NPSH results? What is missing from the NPSH tools in WaterCAD and WaterGEMS that has caused you to look into a WaterObjects.NET tool? What is the end goal that you are looking to achieve?
Jesse DringoliTechnical Support Manager, OpenFlows ProductsBentley Communities Site AdministratorBentley Systems, Inc.
Did you start your plug-in engine implementation using the WaterObjects.NET.NPSHCalculator example as a starting point? If so, you would have implemented a ResultDataConnection class. You will see there are some methods there for managing results.
To implement permanent (file based) results, you have to provide an implementation for all of these methods. That is, one that differs from the in-memory sample implementation.
The methods need to do the following.
Deactivate - For the specified scenario, close the result file and delete it.
HasResults - For the specified scenario, answer whether results exist (will need to check that a valid results file exists for that scenario).
IsActive - For the specified scenario, answers whether the results file is open (e.g., a results reader has the result file open).
Open - For the specified scenario, open the results file so that results are available.
TimeStepsInSeconds - For the specified scenario, answer the time steps that the result set supports.
ResultPathAndFileNamesFor - Answer all the possible results file names for the open model. That is, each and every possible results file managed by your result data connection. This allows the main application to migrate files during file save / open operations etc.
Hope this helps.
EDIT: Changed "field" to "file" in the last item.
I tried implementing the required methods and also save/read scenario data to/from the file.
But to get the additional numerical engine fields of relevant element record (pipe, junction) populated, when a WaterGEMS model is opened, what needs to be done?
Do I need to use some event channel to extend the in-built behavior of WaterGEMS to get the extra fields populated along with default results? Typically Project opened or something similar?
Thanks in anticipation