Coder Social home page Coder Social logo

fams's People

Contributors

jerell avatar

Stargazers

 avatar  avatar

Watchers

 avatar

fams's Issues

Updated to Pressure Drop Calculation - Pressure Drop due to Elevation

Is your feature request related to a problem? Please describe.
Better defines the overall pressure drop calculation

Describe the solution you'd like
Additional equation to account for alongside the main (frictional loss) pressure drop calculation

P_elevation=gΔhρ

P_elevation = The additional pressure loss caused by elevation (no friction) [Pa] (calculated)
g= Acceleration due to gravity [m^2/s) (constant = 9.807)
Δh= Change in elevation [m] (model definition)
ρ= Density [kg/m^3] (calculated)

Δh (change in elevation) is defined h2 - h1, so end elevation minus initial elevation

P_final= P_frictionalloss (current output P2 from pressure drop calc) - P_elevation
P_final will replace P2, the final pressure out of the current calculation.

For logic or error checking, P_elevation should be positive if h2 is elevated higher than h1, therefore Δh is positive.
and P_elevation should be negative if h1 is elevated higher than h2, therefore Δh is negative.
Following this rule it is okay for cases where P_final ends up larger than P_frictionalloss

Happy to clarify any of this if it isn't clear

Pipe section class definition

  • Start node
    • Pressure
    • Temperature
  • End node
    • Pressure
    • Temperature
  • Length
  • Diameter
  • Mass flow rate (kg/s)
  • Direction
  • Pressure change
    • Calculated using pipeline physical properties, flow & direction
  • Temperature change
    • Calculated using pipeline physical properties, flow & direction, and ambient temperature

Initial Pipeline Definition

Initial pipeline will be Stanlow to Connah's Quay, we will need a node for each end to show input and output conditions. For this initial pipeline there will be a constant temperature but varying pressure (pressure drop calculation to follow).
Pipeline details:

  • Internal Diameter: 36"
  • Pipeline Length: 34 km
  • Pipeline material: Placeholder Steel
  • Pipeline Schedule (this is a specification): Placeholder Schedule 30
  • Pipe wall thickness: Placeholder 0.625mm
  • Pipeline overall U-value (thermal transmittance): Placeholder 0 (W/m^2K)
  • Pipeline Bathymetry: This will be "Y" for vertical height against "X" for horizontal distance. For this the pipeline will be split into sections with sub-nodes between them to provide data on the current Y & X at that point. *Placeholder" sub-node every 200m, and for the moment the Y will remain constant at 0m.

Node details:
-Pressure: User input (units: Pa). This will be user input for Stanlow node and then calculated for the Connah's Quay node (calc to follow)

  • Temperature: User input (units: K). This will be user input for Stanlow node and assumed no temperature loss through the system, so Connah's Quay will equal the temperature at the Stanlow Node.
  • Composition: User input composition of the CO2 (units mol%), this should be in a table, initially this will be 100% CO2 but will need the ability to add impurities to the composition in the future. Certain key data will be in this table also such as μ= molecular mass, but other properties will likely be added as complexity increases.
  • Density: Calculation with formula ρ=(Pμ)/(RT), P= Pressure Pa (user input) T= Temperature K (user input) R= Gas Constant (8.31462 units (m3Pa)/(Kmol), μ= Molecular mass units kg/mol, will be based on the composition of the CO2, (0.044 kg/mol)
  • Viscosity: Calculation with formula μ=μ0*((T0+C)/(T+C))*(T/T0)^3/2. μ0= Ref viscosity = 0.018 cp, T0= Ref Temperature = 373 K, C= Southerland constant = 240 T= Temperature K (user input)
    This formula is intended for pure CO2 in gas phase, so will need reviewing when impurities are added, but should give a reference figure at least to work with initially.

I tried to capture as much detail as possible with this to avoid having to add features retrospectively in the future, happy to discuss any of the points here or any changes you think would be good.

Thanks,
Matt

Update to inputs for the pressure drop calculation

Is your feature request related to a problem? Please describe.
Update to inputs for the pressure drop calculation:

  1. Friction factor calculation
  2. Rules for mass flowrate

Describe the solution you'd like

  1. Current friction factor calculation is to be updated to the "Swamee-Jain" explicit approximation:

f= 0.25/([log((ε/3.7D)+(5.74/(Re^0.7)))]^2)

f= friction factor
D= Diameter (m)
Re= Reynolds number
ε= roughness (m) (this will be provided as part of a model definition, but a value of 4.50E-05 can be used as a placeholder for a steel pipe)

Note on accuracy: The approximation from this equation can vary by 2.8% within its applicable range:

  • Reynolds number between 5000 and 3E+8
  • Relative Roughness (ε/D) between 1E-6 and 0.01
  1. Mass flowrate will remain conserved throughout the model, initially set by user input.
  • Mass flowrate can be split between multiple lines as in the example of the "splitter" object, where the flowrate input to the object is equal to the sum of the output flowrates from the object.

Hynet Model - UI requirements

Hynet Model - UI needs to show:

  1. Network - line diagram (as per slack channel)

  2. Snapshot model -

  • Error - Yes/No
  • Table of P, T & Q across the eight points of interest (see below)
  • Show whether the pipeline is gas or liquid
  1. Life of Field mode -
  • Error - Yes/No
  • Table of P, T & Q across the eight points of interest (see below)
  • Animate P & Graphs for each point of interest
  • Show whether the pipeline is gas or liquid

Points of Interest -

  • Compressor
  • Douglas manifold
  • Hamilton - wellhead
  • Hamilton - reservoir
  • Hamilton North - wellhead
  • Hamilton North - reservoir
  • Lennox - wellhead
  • Lennox - reservoir

Node class definition

  • Types
    • source: mass flow in
    • destination: mass flow out
    • internal: mass flow maintained (in = out)
  • No size
  • Multiple pipelines can meet at a single node
    • The pressure of a node is equal to the lowest pressure of the pipelines connected
  • A pressure change must be applied between a pipeline and an end node, if the end node is at a different pressure from the pipeline
  • A positive pressure change is pump or compressor; a negative pressure change is restriction
  • A node on the edge of the network will either have inward gas flow (mass rate kg/s and temperature), outward gas flow, or zero flow (closed end node)
  • Elevation (height above/below sea level) in metres
  • Elevation affects pressure
  • A node must have at least one connection
  • Nodes with only one connection must be a source or destination node

Updated Pressure Drop Calculation

Is your feature request related to a problem? Please describe.
Previous pressure drop calculation given was too simplified

Describe the solution you'd like
The following pressure drop calculation relies on less assumptions for gas phase flow so should give a more accurate output.

Context
For reference here is the initial equation before rearrangement:
w^2=[(DA^2)/(vfL)]-[(P1^2-P2^2)/P1)
The rearrangement for P2 is as such:
P2=((√P1)√((A^2D
P)-(fLv*w^2)))/A√D
(I can provide the non type text versions of these equations if that is clearer)

The terms for this equation are:
w= Mass flowrate [kg/s] (user input)
D= Diameter of pipe [m] (model definition)
A= Cross Sectional Area [m^2] (model definition)
v= Specific Volume [m^3/kg] (v=1/density)
f= Friction Factor (calculated, see below)
L= Pipe Length [m] (model definition)
P1= Initial Pressure [Pa] (user input)
P2= Final Pressure [Pa] (equation output)

The friction factor is dependent on the type of flow in the pipeline, this can be defined using Reynolds number:
Re=(ρuD)/μ

Re= Reynolds Number (equation output)
ρ= Density [kg/m^3] (calculated)
u= Velocity [m/s]
D= Diameter of pipe [m]
μ= Dynamic Viscosity [Pa.s]

Based on the value of Reynolds numbers one of two equations will be used for calculating friction factor.

If Re<2000 (Laminar) then use the following equation:
f=64/Re

f= Friction Factor
Re= Reynolds number

If Re>2000 (Transient/Turbulent) then use the following equation (Weymouth):
f=0.094/((D*1000)^1/3

f= Friction Factor
D= Diameter [m]

Notes on accuracy:

  • 2000<Re<4000 is when the fluid is transient, within this range the Weymouth friction factor will lose accuracy the closer to Re=2000.
  • Weymouth friction factors are most accurate in a 20-inch pipeline. The factor will be greater than Moody chart factors for sizes less than 20-inch, and smaller for sizes larger than 20-inch.

Assumptions that are taken for the basis on this formula:

  1. Isothermal flow.
  2. No mechanical work is done on or by the system.
  3. Steady flow or discharge unchanged with time.
  4. The gas obeys the perfect gas laws.
  5. The velocity may be represented by the average velocity at a cross section.
  6. The friction factor is constant along the pipe.
  7. The pipe line is straight and horizontal between end points.
  8. Acceleration can be neglected because the pipe line is long (This is equivalent to the complete· isothermal equation if the pipe line is long and also for shorter lines if the ratio of pressure drop to initial pressure is small.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.