Valves and pumps are the key components of most piping systems, as they affect how fluid flows through the system and does work. We will first talk about modeling valves; since there is a lot of information in this code, we will break it into separate subsections.
Before we can do anything with individual valves, we have to create a basic Valve class that the unique valves will inherit from. This base class will have to have as many characteristics as each valve type will need to make the base class as generic as possible. The base valve class will be broken up into multiple code listings:
# valve.py (part 1)
1 #!/usr/bin/env python3 2 """ 3 VirtualPLC valve.py 4 5 Purpose...