Location of Calculated Total and Static Pressure for Duct Systems

Location of Calculated Total and Static Pressure for Duct Systems

oliviagFSF72
Explorer Explorer
855 Views
1 Reply
Message 1 of 2

Location of Calculated Total and Static Pressure for Duct Systems

oliviagFSF72
Explorer
Explorer

Hi All,

 

Revit has a Duct Sizing tool that allows users to size duct systems based on 4 different sizing methods. It also has a System Inspector tool that allows users to hover over/click various parts of a system and it displays information such as the section number, total section flow, Total Pressure , Static Pressure, Pressure Loss. In the below images, the pressure-related values are shown as 'Not Computed' as I have not yet run the duct sizing tool on the system.

2025-02-04_08h35_06.png

2025-02-04_08h43_41.png

I would like to know where Revit saves the total and static pressure information shown on the tags. I have looked through the ducting parameters and MEPSystem parameters on Revit Lookup and have been unable to locate it.

 

Please can someone assist.

 

 

 

0 Likes
856 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

They may be calculated dynamically and not stored at all. Here is what Gemini thinks about this:

  

Let's dive into the intricacies of accessing duct pressure information in Revit via the API. You're right, the Total and Static Pressure values displayed by the System Inspector aren't directly stored as parameters on the duct elements or the MEPSystem. Revit calculates these dynamically during duct sizing and analysis. Therefore, you can't directly retrieve them as stored properties.

Here's a breakdown of how to get the pressure information, combining best practices and addressing the nuances of the Revit API:

Understanding the Challenge:

The pressure calculations are performed by Revit's internal analysis engine. The API doesn't expose the raw calculated values directly. We need to leverage the analysis results indirectly.

Solution Strategy:

  1. Execute Duct Sizing: You must programmatically run the duct sizing tool to trigger the pressure calculations.

  2. Access Analysis Results: The key is to access the MEPAnalyticalResults associated with the duct system. This object holds the analysis data, including pressure drop information.

  3. Navigate the Results: The MEPAnalyticalResults provides access to pressure loss information. However, directly getting total and static pressure at a specific point requires some calculation. We typically get pressure drop across a segment.

Code Example (C#):

C#
 
using Autodesk.Revit.DB;
using Autodesk.Revit.MEP;
using System.Collections.Generic;
using System.Linq;

// ... (Revit add-in setup)

public void GetDuctPressure(Document doc, Duct duct)
{
    // 1. Ensure Duct Sizing is Run (Programmatically)
    MEPModel mepModel = doc.GetMEPModel();
    MEPSystem ductSystem = duct.MEPSystem;
    if (ductSystem == null)
    {
        TaskDialog.TaskDialog.Show("Error", "Selected duct is not part of a system.");
        return;
    }

    // Trigger Duct Sizing (Important!)
    mepModel.CalculateDuctSystem(ductSystem); // Or a more specific sizing method if needed


    // 2. Access Analytical Results
    MEPAnalyticalResults results = ductSystem.GetAnalyticalResults();

    if (results == null)
    {
        TaskDialog.TaskDialog.Show("Error", "No analytical results found for the system.");
        return;
    }

    // 3. Navigate and Extract Pressure Drop (Not Total/Static Directly)
    IList<MEPAnalyticalSegment> segments = results.GetAnalyticalSegments();

    foreach (MEPAnalyticalSegment segment in segments)
    {
        ElementId elementId = segment.ElementId; // Get the Duct or Fitting associated with the segment

        if (elementId == duct.Id) // Find the results for our duct.
        {
            // Get Pressure Drop (This is what we can directly access)
            double pressureDrop = segment.PressureDrop; // In Pascals

            // ***Calculating Total and Static Pressure***
            // This is the tricky part.  Revit doesn't directly give total/static at a point.
            // You would typically need to:
            // a. Get the pressure drop across the segment.
            // b. Know the upstream pressure (which might require traversing the system).
            // c. Calculate Static Pressure: Static Pressure (downstream) = Static Pressure (upstream) - Pressure Drop
            // d. Total Pressure: Total Pressure = Static Pressure + Dynamic Pressure (Dynamic Pressure = 0.5 * density * velocity^2. Velocity is also calculated by Revit)
            // You'll likely need to traverse the duct system to build up the pressure profile.

            // Example (Simplified - Requires more context for a real implementation)
            double upstreamStaticPressure = 0; // You'll need to determine this by traversing the system.
            double downstreamStaticPressure = upstreamStaticPressure - pressureDrop;

            // Note: You will need to get the air density and velocity to calculate total pressure.
            double airDensity = 1.225; // Example - Get from project or system properties.
            double velocity = 10; // Example - You need to get this information from Revit analysis.
            double dynamicPressure = 0.5 * airDensity * velocity * velocity;
            double downstreamTotalPressure = downstreamStaticPressure + dynamicPressure;


            TaskDialog.TaskDialog.Show("Duct Pressure Info", $"Pressure Drop: {pressureDrop} Pa, Downstream Static Pressure: {downstreamStaticPressure} Pa, Downstream Total Pressure: {downstreamTotalPressure} Pa");
            break; // Exit loop once we find the duct.
        }
    }
}


Key Improvements and Explanations:

  • Duct Sizing Trigger: Explicitly calls mepModel.CalculateDuctSystem(ductSystem) to ensure the calculations are performed. This is crucial.
  • Analytical Segments: Uses results.GetAnalyticalSegments() which provides a more granular view of the analysis.
  • Pressure Drop: Extracts segment.PressureDrop which is the directly available value.
  • Calculating Total/Static: Explains the crucial point that total and static pressures at a point are not directly available. We must calculate them based on pressure drop and upstream conditions.
  • Simplified Example: Provides a simplified illustration of the calculation. A real implementation requires traversing the duct system.
  • Error Handling: Includes checks for null results and systems.
  • Comments: Added comments for clarity.

Further Considerations:

  • System Traversal: You'll need to implement a method to traverse the duct system to determine upstream pressures. This might involve getting connected elements, their flow directions, and accumulating pressure drops.
  • Air Properties: Get air density from the project or system properties for accurate total pressure calculation.
  • Velocity: You'll need to find a way to get velocity information from the analysis results. This might require further exploration of the MEPAnalyticalResults or related objects.
  • Units: Be mindful of units (Pascals, etc.) and conversions if needed.

This detailed approach should give you a solid foundation for retrieving and calculating duct pressure information in your Revit add-in. Remember, the key is to trigger the analysis and then work with the analytical results. Let me know if you have any other questions.

     

Here is a description by The Building Coder of a modeless pressure drop tool whipped up in 2009, 15 years ago, that might also be of interest:

   

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes