# How can I calculate the positive and negative mass flows through an opening boundary in CFX-Post?

 There are two ways you can do this. Note that both of these methods will give slightly different answers than the mass flows seen by the CFX-Solver. This is because the solver calculates mass flow data on a finer level than is possible in CFX-Post, so the solver data will always be more accurate.1)This method can be used if the boundary lies in one of the three Cartesian planes (XY, YZ, XZ), at a constant radial location, or a constant circumferential location.First create a Contour plot on the boundary using the velocity component normal to the boundary (for example, if the boundary lies in the XY plane, use `Velocity w`). `Velocity Radial` and `Velocity Circumferential` can be generated from the Turbo tab if necessary.Set the `Range` for the Contour plot to `Value List` and enter `0, 0.01`. You may need to use a value smaller than 0.01 if the velocity scale in your simulation is of the same order as this.Next, create a User Surface with the `Method` set to `From Contour`. Select your `Contour Name` from the drop down menu and set the `Contour Level` to 1. This creates a surface corresponding to the areas with positive/negative mass flow. Switching the `Contour Level` to 2 creates a surface corresponding to areas with the opposite mass flow. Lastly, use the Function Calculator to calculate the mass flow rate on the User Surface.2)This method uses expressions and is more general; it can be applied to any boundary of arbitrary shape and orientation. The boundary does not have to be aligned with a coordinate axis and it does not have to be flat. The general approach is to calculate the velocity normal to the surface, split this into positive and negative components, and then calculate the mass flow using these components. First, on the Quantitative tab in CFX-Post create an expression for the velocity normal to the surface:Vnormal = u*Normal X + v*Normal Y + w*Normal ZNow on the Variables tab in CFX-Post create a new variable using this expression, which we`ll name `Velocity Normal`.Next, back on the Quantitative tab create expressions for the positive and negative mass flows:MdotPositive = Density * Area * step(Velocity Normal/1[m/s]) * Velocity NormalMdotNegative = Density * Area * step(-Velocity Normal/1[m/s]) * Velocity NormalAnd finally on the Variables tab create new variables using these two expressions, which we`ll name `MassFlowPositive` and `MassFlowNegative`.You can now use the Function Calculator to evaluate sum(MassFlowPositive)@Location.