Entrance Tank - AguaClara/SWOT GitHub Wiki

Assignment Context

AguaClara Reach is creating the AguaClara Infrastructure Design Engine (AIDE) so that they can provide customized designs of drinking water treatment plants for implementation partners. Conventional design approaches would take months of engineering time to create a water treatment plant design for a community. AIDE makes it possible to change the design inputs and generate a new design in a matter of minutes (or seconds). AIDE makes it possible to mass produce customized designs.

This design challenge is to create a slightly simplified version of an entrance tank for a water treatment plant.

Assignment Logistics

  • The ideal learning method is to do all of the steps of this assignment yourself while working with your teammates to help each other quickly learn the steps.
  • Collaborate with your classmates and TA to learn and complete all of these steps efficiently
  • Work together to polish one of the documents that you and your teammates have created for submission.

You will learn how to

  • perform a series of design steps in FeatureScript
  • connect design results to a 3-D geometric model
  • use existing functions to connect client needs to the design of a system
  • enter params that set minimum, default, and maximum values for inputs
  • access AguaClara functions to calculate the diameter of a pipe
  • see the results of your calculations in the variable table and in a 3-D model of the entrance tank

SetUp

Set up your Onshape workspace so that you have access to the following custom features created by AguaClara. Copy the document path below and paste it into the search box for adding custom features to quickly find each feature.

  1. Civil Tank: inside Core Parts open up tanks and select Civil Tank (cad.onshape.com/documents/c0af0d6b5703e7a8fb53f53f)
  2. Overflow Pipe: select overflow.fs and then select Overflow Pipe (cad.onshape.com/documents/50136809eb4dab5feb113036)
  3. Pipe Hole (cad.onshape.com/documents/c35baaea9a3ba0044a66bc94)

When you have completed these steps all of these features should show up in your custom feature menu.

AIDE Feature Studios

The Feature Studio is where we can do the calculations for the design of the parts that we are making in the Part Studio. AIDE Feature Studios have 3 main sections.

  • Tree - where we define the function calls (designers) and input parameters (params) required for the design. In more complex designs the Tree is also used to define the connections with parts that are children or subcomponents.
  • Designer - where we calculate the dimensions of the part we are designing. The variables that we define are all part of the design map and can be accessed as design.varName. Thus the length of a part would be defined as design.L.
  • Feature - this is the code that inserts the results of our calculations (the design map) into the part studio. This feature is inserted as the very first feature in the part studio so that all of the subsequent features have access to the variables in the design map.

Units in AIDE

Engineering design calculations should always be done using software tools that support units. Units provide an import check on all calculations and using units ensures that the we don't burn up our spacecraft because of a failure to use the right units in an equation. In Onshape all of our calculations include units. Unfortunately there is a limitation on how we pass parameters from one component to another component as we create complex designs with multiple components. To get around this limitation we have adopted a strict variable naming convention so that we know what units a variable has just from looking at its name. Here are a couple examples of variable names, their units [] and an evaluation of whether or not they meet our requirements.

  • myFavorityDimensionIsL [meter] YES!
  • V_MAX [oops] NO! subscripts must be lower case - should be V_max
  • riverQ [meter^3/s] YES!
  • riverQm [L/s] YES! The m really means milli (m^3/s) which is the same as L/s.
  • pipeWallS [meter] YES! This is the Space between a pipe and a wall
  • portB [meter] YES! The center to center to center distance between ports

Hydraulic functions

AguaClara has added a limited number of hydraulic-related functions in FeatureScript in AguaClara Core FS. The most commonly used functions for this course are in the tabs headloss and physical chemistry. The pipe design equations that work for both laminar and turbulent flow regimes are found in those two tabs. For example the function

  • flowPipe(diam, headLoss, length, nu, roughness, kMinor) will calculate the flow rate in a given pipe given the available energy (headLoss).
  • The companion function to calculate the minimum required pipe diameter given a desired flow rate is diamPipe(flowRate, headLoss, length, nu, pipeRough, kMinor)
  • The actual head loss given a pipe and a flow rate is pipeHeadloss(flowRate, diam, length, nu, pipeRough, kMinor)
  • The density and viscosity of water are available as functions of temperature in the physical chemistry tab.

Entrance Tank Design

An AguaClara entrance tank performs the following functions:

  1. removes trash with a trash rack (leaves, twigs, litter) to prevent clogging of the inlet diffusers in the sedimentation tank
  2. removes grit by sedimentation
  3. dumps water that exceeds the design flow rate of the plant
  4. measures the flow into the plant
  5. water level in the entrance tank is used to set the flow of coagulant and chlorine.
  6. coagulant is injected at the outlet of the entrance tank

For this design challenge we will do a simplified design to remove grit and dump excess water.

Part 1: Feature Studio Steps

Begin by creating a copy of the workspace of the Entrance Tank Template. Name the file "[your team name] Entrance Tank".

Follow each step as described in the Entrance Tank.fs for problems 1-11.

Open the tab Entrance Tank.fs. You will see commented out blue directions for the code that you need to create.
This is the core of the coding part of this challenge!

Check that each line of your code works before proceeding to the next step. Monitor FeatureScript Notices to make sure no warnings or errors are being reported. The exception is that it is okay to see warnings that say... "Entrance Tank: Warning: Required input design.Qm_max not found. Default value 0.01 meter^3 second^-1 used instead." FeatureScript Notices will also show your printed answers as you are working if you select Monitoring Entrance Tank PS in the upper right of the FeatureScript window.

NOTE: Question 3 in the FeatureScript mentions using either an if statement or a min/max function, we recommend using the min/max function!

A few hints for FeatureScript

  • almost all lines of code end in a semicolon;
  • new variables that are part of the design map can be defined like this example: design.planViewA_min = design.Qm_max * design.captureV;

Part 2: Part Studio Steps

  1. Insert the Civil Tank feature into the part studio and link design variables that you created in the Entrance Tank.fs to the Civil Tank

    • implementation partner ip

    • inside wall height H

    • water depth HW

    • tank length L

    • tank width W

    • constants for other inputs constants

    • Location can be set by clicking in the blue box in the drop down menu labeled 'Location(s)' and then clicking on the origin of the Part Studio location

Selecting the option to place design in context will take the dimensions and other part information of the tank and add that to a map (called tank in this case) so that those parameters can be used in subsequent design steps. You can see the tank map by clicking on the variable table on the middle right side of the screen. The resulting tank should look like this! iso

  1. All of the parts we are using for design come from a database that includes costs. To view this information, access the bill of materials and cut list custom tables by clicking on custom tables.

  2. Add the overflow pipe to the part studio. The goal is to place the overflow pipe centered in the tank and perhaps a distance of the tank width/2 from the end of the tank. The overflow pipe origin is at the center of the pipe at the top surface of the bottom of the tank. You can select a good mate connector for the location by hovering over the bottom of the tank and then moving your mouse toward the end of the tank where you want to install the overflow pipe.

mateAtEndOfTank

Click on the mate connector to select it. The blue location box should now have a reference to the selected mate connector. clickToEditMate Click on the reference to the mate connector in the location box to edit the mate connector. This is a cool feature that makes it easy to move the part to exactly where you want it. In this case we want to move the overflow pipe away from the very end of the tank by a distance of W/2. Enter the Y value move distance as shown.

editMate

Now close the Mate connector dialog box and the overflow pipe should be at the correct location.

Link the minimum temperature, flow rate, water depth, and maximum pipe SDR to params that are inputs for your design. The flow safety factor can be set to 1 and the depth safety factor set to 0 meter. The length of pipe below the bottom of the tank can be used to ensure that the pipe goes the whole way through the bottom slab. To do this we can link to the slab thickness. Given that the Civil Tank put its dimension info in the map "tank" we can access that inside the Overflow Pipe as #tank.slab.T. You can look at the bottom of the tank and see that the pipe is trying to break through the surface.

The last step is to delete the concrete to make a hole for the overflow pipe. Use the Pipe Hole feature. The easiest way to select the pipes that need to go through the wall is to select the Feature that made the pipes. Thus select the overflow pipe feature in the feature list as the pipeline feature in the dialog box.

Play and Reflect!

Send an email to the TA with your answers to the following questions.

  1. How much does the entrance tank cost for a 10 L/s flow rate?
  2. Which part is most expensive? You can edit the overrides to get new designs quickly. Change the flow rate to 100 L/s.
  3. Why did the tank get wider? Which design constraint controls the width?
  4. Why did the tank get deeper? Which design constraint controls the depth?
  5. Why did the overflow pipe diameter change?
  6. We could have done this assignment using pencil and paper or and Excel spreadsheet for the design and a cad program for the drawing. List as many advantages and disadvantages as you can for the Onshape AIDE design process vs Excel and a cad program.
  7. Make one change or addition to the design. It can be anything. Here are some ideas...
    • Add a new param for the minimum distance between the cap of the overflow pipe and the end wall of the tank and then move the overflow pipe into that new position.
    • Add a channel below the entrance tank that will collect the overflow water.
    • Replace the tank slab with hoppers so that the sediment that is captured can drain out.
    • Add a pipe representing the inlet that would dump water into the entrance tank near the overflow pipe.
    • Your idea here!