Fluid_Aspect_Course_2_6_2 - nasa/gunns GitHub Wiki

Fluid Aspect Course 2.6.2: Integrate Flows

Integrate Flows

After all of the links have transported their flows into and out of the nodes, the solver loops over the nodes and calls their integrateFlows method. This is where the nodes mix all the flows and balance the final fluid states of their contents.

  • For both inflows and outflows, the node integrates the flow rates into a change in mass dm for this step as: dm = ṁ·dt.
    • This is the same Backwards Euler integration for which the effects are derived.
  • For non-capacitive nodes, the inflow moles equals the outflow moles, and KCL is satisfied because the network is moles-based.
    • If inflow & outflow fluids have the same mixture, in & out mass is also the same and mass is conserved.
    • If inflow & outflow fluids have differing mixture, then in & out mass is not the same and mass is not conserved. This is a mass overflow, discussed below.
  • For capacitive nodes, which have fluid volume, the inflow moles can be different than the outflow moles, and there results a net change in total moles stored in the node.
    • KCL is satisfied when we consider that the net flow is across the capacitance effect link. The volume & mass is still stored in the node object for convenience.
    • Mass overflows occur when the outflow mass exceeds the initial mass in the node.

State Error & Correction

  • Node pressures are only calculated by the solver in its network solution, and the node is forced to use that solution as its pressure.
  • After the flows into the node have been integrated and the rest of the fluid properties calculated (density, temperature, etc), the node’s pressure from the network solution can disagree with what the fluid’s pressure ought to be by its PVT equation of state.
    • This is called “State Error”.
    • It is caused by the fact that fluid capacitance is not constant, but the solver has to assume constant capacitance over the time step.
    • Occurs when flowing in fluids of different mixture & temperature than the node’s contents.
  • State Error is usually small (1 kPa or less).
    • GUNNS corrects it automatically, so state error washes out over time.
    • This is done in a way that conserves mass & energy — the correction considers the mass & energy in the node to be correct, and the network pressure solution to be in error. So the pressure solution is corrected in subsequent passes.
  • No action needed on your part, but:
    • Be aware that this is happening all the time,
    • Checking the size of the state error & amount of correction is a measure of network health (discussed later).
  • More info about state error here.

Mass Overflows

  • “Mass Overflows” happen whenever you have more mass of flow through a node over a timestep than the mass in the node at the instant in time at the beginning of the time step.
  • This happens when you have large flows through small volumes over large time steps.
  • Mass overflows always occur in non-capacitive nodes, because they contain zero mass.
  • Mass overflows should be avoided because:
    • Mass of constituents isn’t conserved if the mixture is changing. Total mass is conserved, but constituents get changed from one type to another.
    • Energy isn’t conserved if temperature is changing.
  • Normally these non-conservation errors are very small compared to the total mass or energy in the network.
    • TS-21 fluid networks are riddled with these, but they don’t notice.
    • If you’re interested in strictly conserving mass & energy, avoid overflows.
  • Overflows can be avoided by:
    • Making node volumes larger,
    • Using smaller time steps,
    • Using lower flow rates.
  • Node volumes and flow rates are often constrained to what you’re simulating, so the only option that doesn’t impact accuracy is to increase the execution rate.
    • Therefore there is an upper limit to timestep size. You can’t just step your networks once an hour.
    • But increasing execution rate uses a lot more CPU. Often we just use larger volumes instead.
  • Nodes can tell you when they’re overflowing (discussed later).

Previous Page / Next Page

⚠️ **GitHub.com Fallback** ⚠️