Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding trapped mass as output from compositional statistics #2052

Merged
merged 25 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d5f9a8c
cleaned up bc
francoishamon Aug 6, 2022
30220f2
Merge branch 'develop' into refactor/hamon/bcCleanup
francoishamon Aug 14, 2022
227e32f
Merge branch 'develop' into refactor/hamon/bcCleanup
francoishamon Aug 21, 2022
9d5eca8
Merge branch 'develop' into refactor/hamon/bcCleanup
francoishamon Aug 23, 2022
f811a4b
WIP
MatthiasCremon Aug 23, 2022
3add582
Merge branch 'develop' into matthias/exp_mgr_strategies
MatthiasCremon Aug 24, 2022
1136777
first working prototype
MatthiasCremon Aug 24, 2022
aa0ff5b
move-up m_phaseMinVolFrac to get it while stat-ing compflow
Sep 6, 2022
0f5c7a0
adding basic immobile mass in comp stats
Sep 6, 2022
d7e26ec
refact rename immobilePhase->trappedPhase
jafranc Sep 7, 2022
683af41
adding element-wise trapped saturation to be integrated over
Sep 7, 2022
2940b7a
Merge remote-tracking branch 'remotes/origin/matthias/exp_mgr_strateg…
jafranc Sep 7, 2022
7d089cf
introducing tracking of critical sat in hysteresis
jafranc Sep 8, 2022
5d1a6e1
revert matthias/exp_mgr_strategies merge
Sep 9, 2022
88c88fd
some clean up and uncrustify
Sep 9, 2022
f34bfdd
Addressing Francois coment on naming conv and array2d->array3d
jafranc Sep 9, 2022
5ee8124
uncrustify
jafranc Sep 9, 2022
8052c80
implementing Francois's refactor
jafranc Sep 9, 2022
55327b9
Merge branch 'develop' into jafranc/feat/add-mobile-comp-stat
jafranc Sep 9, 2022
c921a1d
life is better with labels
jafranc Sep 9, 2022
410e6ac
Merge remote-tracking branch 'origin/jafranc/feat/add-mobile-comp-sta…
jafranc Sep 9, 2022
0a701d0
Merge remote-tracking branch 'origin/develop' into jafranc/feat/add-m…
Sep 14, 2022
ae690b8
Merge remote-tracking branch 'origin/jafranc/feat/add-mobile-comp-sta…
Sep 14, 2022
b42c09c
Merge branch 'develop' into jafranc/feat/add-mobile-comp-stat
Sep 14, 2022
7f4973f
updated integratedTests submodule
francoishamon Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updated integratedTests submodule
  • Loading branch information
francoishamon committed Sep 15, 2022
commit 7f4973f819cdb85ea4a755f6e78c7c4c4832a513
2 changes: 1 addition & 1 deletion integratedTests
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class BrooksCoreyBakerRelativePermeabilityUpdate final : public RelativePermeabi
arrayView3d< real64, relperm::USD_RELPERM > const & phaseTrappedVolFrac )
: RelativePermeabilityBaseUpdate( phaseTypes,
phaseOrder,
phaseMinVolumeFraction,
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac,
phaseTrappedVolFrac ),
m_phaseMinVolumeFraction( phaseMinVolumeFraction ),
m_waterOilRelPermExponent( waterOilRelPermExponent ),
m_waterOilRelPermMaxValue( waterOilRelPermMaxValue ),
m_gasOilRelPermExponent( gasOilRelPermExponent ),
Expand Down Expand Up @@ -97,6 +97,8 @@ class BrooksCoreyBakerRelativePermeabilityUpdate final : public RelativePermeabi
real64 & relPerm,
real64 & dRelPerm_dVolFrac );

arrayView1d< real64 const > m_phaseMinVolumeFraction;

arrayView1d< real64 const > m_waterOilRelPermExponent;
arrayView1d< real64 const > m_waterOilRelPermMaxValue;

Expand Down Expand Up @@ -127,6 +129,7 @@ class BrooksCoreyBakerRelativePermeability : public RelativePermeabilityBase

struct viewKeyStruct : RelativePermeabilityBase::viewKeyStruct
{
static constexpr char const * phaseMinVolumeFractionString() { return "phaseMinVolumeFraction"; }
static constexpr char const * waterOilRelPermExponentString() { return "waterOilRelPermExponent"; }
static constexpr char const * waterOilRelPermMaxValueString() { return "waterOilRelPermMaxValue"; }
static constexpr char const * gasOilRelPermExponentString() { return "gasOilRelPermExponent"; }
Expand All @@ -138,6 +141,8 @@ class BrooksCoreyBakerRelativePermeability : public RelativePermeabilityBase

virtual void postProcessInput() override;

array1d< real64 > m_phaseMinVolumeFraction;

// water-oil data
array1d< real64 > m_waterOilRelPermExponent;
array1d< real64 > m_waterOilRelPermMaxValue;
Expand Down Expand Up @@ -266,14 +271,19 @@ BrooksCoreyBakerRelativePermeabilityUpdate::
dPhaseRelPerm_dPhaseVolFrac[ipOil] );
}

//update trapped
// update trapped phase volume fraction
if( ipWater >= 0 )
phaseTrappedVolFrac[ipWater] = std::min( phaseVolFraction[ipWater], m_phaseMinVolumeFraction[ipWater] );
{
phaseTrappedVolFrac[ipWater] = LvArray::math::min( phaseVolFraction[ipWater], m_phaseMinVolumeFraction[ipWater] );
}
if( ipGas >= 0 )
phaseTrappedVolFrac[ipGas] = std::min( phaseVolFraction[ipGas], m_phaseMinVolumeFraction[ipGas] );
{
phaseTrappedVolFrac[ipGas] = LvArray::math::min( phaseVolFraction[ipGas], m_phaseMinVolumeFraction[ipGas] );
}
if( ipOil >= 0 )
phaseTrappedVolFrac[ipOil] = std::min( phaseVolFraction[ipOil], m_phaseMinVolumeFraction[ipOil] );

{
phaseTrappedVolFrac[ipOil] = LvArray::math::min( phaseVolFraction[ipOil], m_phaseMinVolumeFraction[ipOil] );
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class BrooksCoreyRelativePermeabilityUpdate final : public RelativePermeabilityB
arrayView3d< real64, relperm::USD_RELPERM > const & phaseTrappedVolFrac )
: RelativePermeabilityBaseUpdate( phaseTypes,
phaseOrder,
phaseMinVolumeFraction,
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac,
phaseTrappedVolFrac ),
m_phaseMinVolumeFraction( phaseMinVolumeFraction ),
m_phaseRelPermExponent( phaseRelPermExponent ),
m_phaseRelPermMaxValue( phaseRelPermMaxValue ),
m_volFracScale( volFracScale )
Expand All @@ -69,6 +69,7 @@ class BrooksCoreyRelativePermeabilityUpdate final : public RelativePermeabilityB

private:

arrayView1d< real64 const > m_phaseMinVolumeFraction;
arrayView1d< real64 const > m_phaseRelPermExponent;
arrayView1d< real64 const > m_phaseRelPermMaxValue;
real64 m_volFracScale;
Expand Down Expand Up @@ -97,6 +98,7 @@ class BrooksCoreyRelativePermeability : public RelativePermeabilityBase
//START_SPHINX_INCLUDE_01
struct viewKeyStruct : RelativePermeabilityBase::viewKeyStruct
{
static constexpr char const * phaseMinVolumeFractionString() { return "phaseMinVolumeFraction"; }
static constexpr char const * phaseRelPermExponentString() { return "phaseRelPermExponent"; }
static constexpr char const * phaseRelPermMaxValueString() { return "phaseRelPermMaxValue"; }
static constexpr char const * volFracScaleString() { return "volFracScale"; }
Expand All @@ -108,6 +110,7 @@ class BrooksCoreyRelativePermeability : public RelativePermeabilityBase
virtual void postProcessInput() override;

//START_SPHINX_INCLUDE_02
array1d< real64 > m_phaseMinVolumeFraction;
array1d< real64 > m_phaseRelPermExponent;
array1d< real64 > m_phaseRelPermMaxValue;

Expand Down Expand Up @@ -146,7 +149,7 @@ BrooksCoreyRelativePermeabilityUpdate::
phaseRelPerm[ip] = (satScaled <= 0.0) ? 0.0 : scale;
}

phaseTrappedVolFrac[ip] = std::min( phaseVolFraction[ip], m_phaseMinVolumeFraction[ip] );
phaseTrappedVolFrac[ip] = LvArray::math::min( phaseVolFraction[ip], m_phaseMinVolumeFraction[ip] );

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RelativePermeabilityBase::RelativePermeabilityBase( string const & name, Group *
registerExtrinsicData( extrinsicMeshData::relperm::dPhaseRelPerm_dPhaseVolFraction{},
&m_dPhaseRelPerm_dPhaseVolFrac );

registerExtrinsicData( extrinsicMeshData::relperm::phaseTrapped{}, &m_phaseTrappedVolFrac );
registerExtrinsicData( extrinsicMeshData::relperm::phaseTrappedVolFraction{}, &m_phaseTrappedVolFrac );

}

Expand Down Expand Up @@ -103,8 +103,8 @@ void RelativePermeabilityBase::setLabels()
getExtrinsicData< extrinsicMeshData::relperm::phaseRelPerm >().
setDimLabels( 2, m_phaseNames );

getExtrinsicData< extrinsicMeshData::relperm::phaseTrapped>().
setDimLabels( 2, m_phaseNames );
getExtrinsicData< extrinsicMeshData::relperm::phaseTrappedVolFraction >().
setDimLabels( 2, m_phaseNames );
}

void RelativePermeabilityBase::allocateConstitutiveData( dataRepository::Group & parent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,18 @@ class RelativePermeabilityBaseUpdate

RelativePermeabilityBaseUpdate( arrayView1d< integer const > const & phaseTypes,
arrayView1d< integer const > const & phaseOrder,
arrayView1d< real64 const > const & phaseMinVolFrac,
arrayView3d< real64, relperm::USD_RELPERM > const & phaseRelPerm,
arrayView4d< real64, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac,
arrayView3d< real64, relperm::USD_RELPERM > const & phaseTrappedVolFrac )
: m_phaseTypes( phaseTypes ),
m_phaseOrder( phaseOrder ),
m_phaseMinVolumeFraction( phaseMinVolFrac ),
m_phaseRelPerm( phaseRelPerm ),
m_dPhaseRelPerm_dPhaseVolFrac( dPhaseRelPerm_dPhaseVolFrac ),
m_phaseTrappedVolFrac( phaseTrappedVolFrac ) {}

arrayView1d< integer const > m_phaseTypes;
arrayView1d< integer const > m_phaseOrder;

arrayView1d< real64 const > m_phaseMinVolumeFraction;

arrayView3d< real64, relperm::USD_RELPERM > m_phaseRelPerm;
arrayView4d< real64, relperm::USD_RELPERM_DS > m_dPhaseRelPerm_dPhaseVolFrac;

Expand Down Expand Up @@ -132,8 +128,7 @@ class RelativePermeabilityBase : public ConstitutiveBase

arrayView1d< string const > phaseNames() const { return m_phaseNames; }

arrayView1d< real64 const > phaseMinVolumeFraction() const { return m_phaseMinVolumeFraction; }
arrayView3d< real64 const, relperm::USD_RELPERM > phaseTrapped() const { return m_phaseTrappedVolFrac; }
arrayView3d< real64 const, relperm::USD_RELPERM > phaseTrappedVolFraction() const { return m_phaseTrappedVolFrac; }

arrayView3d< real64 const, relperm::USD_RELPERM > phaseRelPerm() const { return m_phaseRelPerm; }
arrayView4d< real64 const, relperm::USD_RELPERM_DS > dPhaseRelPerm_dPhaseVolFraction() const { return m_dPhaseRelPerm_dPhaseVolFrac; }
Expand All @@ -150,7 +145,6 @@ class RelativePermeabilityBase : public ConstitutiveBase
static constexpr char const * phaseNamesString() { return "phaseNames"; }
static constexpr char const * phaseTypesString() { return "phaseTypes"; }
static constexpr char const * phaseOrderString() { return "phaseOrder"; }
static constexpr char const * phaseMinVolumeFractionString() { return "phaseMinVolumeFraction"; }
};

private:
Expand All @@ -177,7 +171,6 @@ class RelativePermeabilityBase : public ConstitutiveBase
// phase ordering info
array1d< integer > m_phaseTypes;
array1d< integer > m_phaseOrder;
array1d< real64 > m_phaseMinVolumeFraction;

// output quantities
array3d< real64, relperm::LAYOUT_RELPERM > m_phaseRelPerm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ EXTRINSIC_MESH_DATA_TRAIT( dPhaseRelPerm_dPhaseVolFraction,
NO_WRITE,
"Derivative of phase relative permeability with respect to phase volume fraction" );

EXTRINSIC_MESH_DATA_TRAIT( phaseTrapped,
"phaseTrapped",
EXTRINSIC_MESH_DATA_TRAIT( phaseTrappedVolFraction,
"phaseTrappedVolFraction",
array3dLayoutRelPerm,
0,
LEVEL_0,
WRITE_AND_READ,
"Phase trapped" );
"Phase trapped volume fraction" );

EXTRINSIC_MESH_DATA_TRAIT( phaseMaxHistoricalVolFraction,
"phaseMaxHistoricalVolFraction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ TableRelativePermeability::KernelWrapper::
arrayView3d< real64, relperm::USD_RELPERM > const & phaseTrappedVolFrac )
: RelativePermeabilityBaseUpdate( phaseTypes,
phaseOrder,
phaseMinVolumeFraction,
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac,
phaseTrappedVolFrac ),
m_phaseMinVolumeFraction( phaseMinVolumeFraction ),
m_relPermKernelWrappers( relPermKernelWrappers )
{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class TableRelativePermeability : public RelativePermeabilityBase

private:

arrayView1d< real64 const > m_phaseMinVolumeFraction;

/// Kernel wrappers for relative permeabilities in the following order:
/// Two-phase flow:
/// 0- wetting-phase
Expand All @@ -113,8 +115,6 @@ class TableRelativePermeability : public RelativePermeabilityBase
/// 3- intermediate phase (non-wetting-intermediate data)
arrayView1d< TableFunction::KernelWrapper const > m_relPermKernelWrappers;

/// Minimum volume fraction for each phase (deduced from the table)
arrayView1d< real64 const > m_phaseMinVolumeFraction;
};

/**
Expand All @@ -126,6 +126,7 @@ class TableRelativePermeability : public RelativePermeabilityBase
struct viewKeyStruct : RelativePermeabilityBase::viewKeyStruct
{
static constexpr char const * relPermKernelWrappersString() { return "relPermWrappers"; }
static constexpr char const * phaseMinVolumeFractionString() { return "phaseMinVolumeFraction"; }
static constexpr char const * wettingNonWettingRelPermTableNamesString() { return "wettingNonWettingRelPermTableNames"; }
static constexpr char const * wettingIntermediateRelPermTableNamesString() { return "wettingIntermediateRelPermTableNames"; }
static constexpr char const * nonWettingIntermediateRelPermTableNamesString() { return "nonWettingIntermediateRelPermTableNames"; }
Expand Down Expand Up @@ -162,6 +163,9 @@ class TableRelativePermeability : public RelativePermeabilityBase
/// 3- intermediate phase (non-wetting-intermediate data)
array1d< TableFunction::KernelWrapper > m_relPermKernelWrappers;

/// Min phase volume fractions (deduced from the tables). With Baker, only the water phase entry is used
array1d< real64 > m_phaseMinVolumeFraction;

};

GEOSX_HOST_DEVICE
Expand Down Expand Up @@ -298,13 +302,20 @@ TableRelativePermeability::KernelWrapper::
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac );
}
//update trapped

// update trapped phase volume fraction
if( ipWater >= 0 )
phaseTrappedVolFrac[ipWater] = std::min( phaseVolFraction[ipWater], m_phaseMinVolumeFraction[ipWater] );
{
phaseTrappedVolFrac[ipWater] = LvArray::math::min( phaseVolFraction[ipWater], m_phaseMinVolumeFraction[ipWater] );
}
if( ipGas >= 0 )
phaseTrappedVolFrac[ipGas] = std::min( phaseVolFraction[ipGas], m_phaseMinVolumeFraction[ipGas] );
{
phaseTrappedVolFrac[ipGas] = LvArray::math::min( phaseVolFraction[ipGas], m_phaseMinVolumeFraction[ipGas] );
}
if( ipOil >= 0 )
phaseTrappedVolFrac[ipOil] = std::min( phaseVolFraction[ipOil], m_phaseMinVolumeFraction[ipOil] );
{
phaseTrappedVolFrac[ipOil] = LvArray::math::min( phaseVolFraction[ipOil], m_phaseMinVolumeFraction[ipOil] );
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ TableRelativePermeabilityHysteresis::KernelWrapper::KernelWrapper( arrayView1d<
arrayView4d< real64, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac )
: RelativePermeabilityBaseUpdate( phaseTypes,
phaseOrder,
drainagePhaseMinVolFraction,
phaseRelPerm,
dPhaseRelPerm_dPhaseVolFrac,
phaseTrappedVolFrac ),
Expand Down
Loading