Skip to content
Snippets Groups Projects

Correct computation of molar densities (fixes small mass balances errors)

Merged Simon Emmert requested to merge feature/useComplexRelations into master

Closes #450 (closed) Depends !836 (merged)

-name change is subject to further discussion (new Issue: #509 (closed))

  • Introduce liquidMolarDensity and gasMolarDensity for components
  • Use more meaningful functions in computation of the molar density
  • in tutorial include liquidmolardensity in mycompressible component
  • introduce molardensity in new liquid and gas component

in component LNAPL include a liquidmolardensity -> opened Issue #464 (closed)

To summarize the changes:

  • introduced liquidMolarDensity() respectively gasMolarDensity() in all fluid components
    • liquidMolarDensity as liquidDensity(temperature, pressure)/molarMass();
    • gasMolarDensity as IdealGas::molarDensity(temperature, pressure);
    • exceptions are:
      • brine: salinity is included in the liquidMolarDensity
      • co2: is not considered an ideal gas, therefore gasDensity(temperature, pressure)/molarMass(); is used
      • h2o: gasMolarDensity uses IAPWS by gasDensity(temperature, pressure)/molarMass();
      • mesitylene: liquidMolarDensity was already implemented with a law from Reid et al. 1987 (see Doxygen)
      • xylene: liquidMolarDensity was already implemented with a law from Reid et al. 1987 (see Doxygen)
  • introduced molarDensity() in all fluidsystems
    • for wPhaseIdx: MainComponent::liquidMolarDensity(temperature, pressure)
    • for a gas nPhaseIdx and !useComplexRelations: IdealGas::molarDensity(temperature, pressure)
    • for a gas nPhaseIdx and useComplexRelations: Component1::gasMolarDensity(temperature, pressure) + Component2::gasMolarDensity(temperature, pressure) + ...
    • for a NAPL nPhaseIdx: NAPL::liquidMolarDensity(temperature, pressure);
    • exceptions are:
      • co2: density(fluidState, phaseIdx)/fluidState.averageMolarMass(phaseIdx)
      • spe5: uses Peng-Robinson molarVolume calculation as before
  • all general fluidstates have setMolarDensity(), and the volVars set the densities in the fluidstate and get them directly from the fluidstate instead of calculating density()/averageMolarMass()
  • exceptions:
    • tracer: uses fluidDensity_/fluidMolarMass_;
Edited by Timo Koch

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • Timo Koch
  • the molarDensity function has to be implemented to match the density function. If density is compositional then it's density(fluidState, paramCache, phaseIdx)/fluidState.averageMolarMass(phaseIdx);, non-compositional it's density(fluidState, paramCache, phaseIdx)/ mainPhaseComponentMolarMass;. If the density does different staff for each phase, the molarDensity also has to do different stuff per phase.

    Edited by Timo Koch
  • Simon Emmert added 1 commit

    added 1 commit

    • 4a9a62d2 - [fluidsystems]add more consistency to fluidsystem molarDensity

    Compare with previous version

  • Simon Emmert added 9 commits

    added 9 commits

    • 4a9a62d2...00c125ff - 2 commits from branch next
    • 749b1f84 - [material] move molarDensity to fluidsystem
    • c27af544 - [material] add molarDensity to all fluidsystem, check liquidphase2c changes later again
    • bc9527b9 - [material] set molar density everywhere where density is set and include correct…
    • 7b25ead7 - [fluidsystem] cleanup
    • ac6ac67f - [fluistates] get molarDensity from fluidState and not from FluidSystem
    • 2ec27f40 - [material] fix paramCache + cleanup
    • a36dcf87 - [fluidsystems]add more consistency to fluidsystem molarDensity

    Compare with previous version

  • Timo Koch added 90 commits

    added 90 commits

    • a36dcf87...fb37a384 - 83 commits from branch next
    • b684fcfc - [material] move molarDensity to fluidsystem
    • a6d16cc1 - [material] add molarDensity to all fluidsystem, check liquidphase2c changes later again
    • 71c53e00 - [material] set molar density everywhere where density is set and include correct…
    • 68107c70 - [fluidsystem] cleanup
    • fd362b5a - [fluistates] get molarDensity from fluidState and not from FluidSystem
    • a61dc5fc - [material] fix paramCache + cleanup
    • d7ba0660 - [fluidsystems]add more consistency to fluidsystem molarDensity

    Compare with previous version

  • Timo Koch marked as a Work In Progress

    marked as a Work In Progress

  • Timo Koch changed the description

    changed the description

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading