OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
XSection.cpp File Reference

Cross-section geometry — faithful 1:1 port of legacy xsect.c. More...

#include "XSectBatch.hpp"
#include "xsect_tables.hpp"
#include "XSectLookup.hpp"
#include "XSectKernels.hpp"
#include <array>
#include <cmath>
#include <algorithm>
Include dependency graph for XSection.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::xsect
 

Functions

double openswmm::xsect::getAofY (const XSectParams &xs, double y)
 Query native wetted area from depth through the shared host evaluator.
 
double openswmm::xsect::getWofY (const XSectParams &xs, double y)
 Query native top width from depth through the shared host evaluator.
 
double openswmm::xsect::getRofA (const XSectParams &xs, double a)
 Query native hydraulic radius from area through the shared host evaluator.
 
double openswmm::xsect::getSofA (const XSectParams &xs, double a)
 Query native section factor from area through the shared host evaluator.
 
double openswmm::xsect::getdSdA (const XSectParams &xs, double a)
 Query native section-factor derivative with respect to area through the shared host evaluator.
 
double openswmm::xsect::getAmax (const XSectParams &xs)
 Read the built-in area-at-maximum-conveyance ratio.
 
const XsectTables & openswmm::xsect::hostTables ()
 Borrow host pointers, lengths and inverse maps for every built-in geometry table.
 
const XsectEval & openswmm::xsect::hostEval ()
 Borrow the immutable host evaluator bound to process-lifetime tables.
 
int openswmm::xsect::locate (double y, const double *table, int n)
 Find a lower bracket in a nondecreasing geometry table.
 
double openswmm::xsect::lookup (double x, const double *table, int n_items)
 Interpolate a borrowed equally spaced normalized geometry table.
 
double openswmm::xsect::invLookup (double y, const double *table, int n_items, const LocateLut *lut=nullptr)
 Invert a borrowed normalized geometry table including the legacy declining top.
 
double openswmm::xsect::getYcircular (double alpha)
 Compute normalized circular depth from area ratio.
 
double openswmm::xsect::getScircular (double alpha)
 Compute normalized circular section factor from area ratio.
 
double openswmm::xsect::getRofY (const XSectParams &xs, double y)
 Query native hydraulic radius from depth through the shared host evaluator.
 
double openswmm::xsect::getYofA (const XSectParams &xs, double a)
 Query native depth from area through the shared host evaluator.
 
double openswmm::xsect::getAofS (const XSectParams &xs, double s_factor)
 Query native area from section factor through the shared host evaluator.
 
double openswmm::xsect::getYcrit (const XSectParams &xs, double q)
 Query native critical depth from discharge through the shared host evaluator.
 
bool openswmm::xsect::isOpen (int type)
 Classify a kernel shape using the legacy open-section set.
 
int openswmm::xsect::setParams (XSectParams &xs, int type, const double p[], double ucf)
 Derive native full-flow geometry from authored shape dimensions.
 

Detailed Description

Cross-section geometry — faithful 1:1 port of legacy xsect.c.

All formulas, lookup tables, constants, and dispatch logic are direct translations from src/legacy/engine/xsect.c (SWMM 5.2.x). Table data comes from xsect_tables.hpp. Numerical parity with the legacy engine is verified shape-by-shape by tests/unit/engine/test_xsect_parity.cpp.

Field-name mapping (legacy TXsect -> XSectParams): yFull->y_full wMax->w_max ywMax->yw_max aFull->a_full rFull->r_full sFull->s_full sMax->s_max yBot->y_bot aBot->a_bot sBot->s_bot rBot->r_bot

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0