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

Factoring hysteresis model out of TableRelativePermeabilityHysteresis #2207

Open
wants to merge 51 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
87d210e
save commit before refactoring
jafranc Nov 10, 2022
4e937e1
factor out Killough Parameters to be used by TableHysteresis
jafranc Nov 11, 2022
81a85cc
Adding TableCapillaryPressureHysteresis class
jafranc Nov 12, 2022
162b899
adding phaseVolTrapped to CapillaryBase + inheritance
jafranc Nov 16, 2022
b4456bf
adding Hysteresis capillary table
jafranc Nov 16, 2022
fa48972
few correction/missing parts
Nov 17, 2022
35988c4
uncrustify + some corrections
Nov 19, 2022
4e4956c
addding save converged state for capillary model
Nov 30, 2022
67a3cf7
adding headers and minor fixes
Nov 30, 2022
505d475
adding a test for capillary hysteresis
Nov 30, 2022
3da2cd5
adapt test for hyst relperm
Nov 30, 2022
a016798
uncrustify
Nov 30, 2022
c4c592e
uncrustified + bounded F ratio
Nov 30, 2022
6701749
added a Logic error
Dec 2, 2022
21f6a3b
add flags logic and correct 2phase
Dec 2, 2022
3da4473
flags as cell-wise fields
Dec 5, 2022
f766c68
adding a test case
Dec 5, 2022
63a086b
clean capillaryPCHyst + fix few filename convention
Dec 9, 2022
cc01813
init KilloughHysteresis obj through relpermClass + usage of 3-points …
Dec 9, 2022
c5ae8cd
start revising unitest
Dec 9, 2022
53e89f5
cleaning up interfaces
jafranc Dec 9, 2022
ea74141
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
Dec 13, 2022
7ce9a1b
clean up post-merge
Dec 13, 2022
1b60f12
fix trapped fraction
Dec 13, 2022
1540d0d
make KilloughHysteresis a simple helpers class
Dec 14, 2022
fcf366b
reorderd messed ratio
Dec 14, 2022
5067990
some more comments and uncrustify
Dec 14, 2022
32a366d
Residual clean up from branching f766c68
Jan 24, 2023
d60e095
Clean and made KilloughHysteresis static
Jan 25, 2023
6e52e30
discard wip-test
Jan 25, 2023
04fdd27
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
Jan 25, 2023
3a8b75d
post-merge/ fix minPhaseFraction getters
Jan 25, 2023
a01db8c
uncrustify
Jan 25, 2023
71ba079
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
jafranc Feb 27, 2023
2fd8bca
correcting GPU and compile issue for CI
jafranc Feb 28, 2023
4c37c18
restoring original namespacing
Mar 1, 2023
9bb24bb
fixing dataRepository::details and geosx::details clash
Mar 1, 2023
d3cc4b4
fixing missing marked HOST_DEVICE
Mar 1, 2023
9f12e94
moving defs and inlining for GPU support
jafranc Mar 2, 2023
8172f34
adress Francois's comments
Apr 11, 2023
5c45a8f
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
Apr 11, 2023
dd9c747
indentation and m_isWetting as mem var
Apr 11, 2023
deba706
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
francoishamon Jul 7, 2023
de8b09d
added doxygen
francoishamon Jul 7, 2023
d7cd842
fixed unit test
francoishamon Jul 7, 2023
820dbac
first bugfixes
francoishamon Jul 7, 2023
ac5edaa
fixed bug
francoishamon Jul 10, 2023
825e571
Merge branch 'develop' into jafranc/refactor/relpermHysteresis
francoishamon Jul 21, 2023
992deac
updated integratedTests submodule
francoishamon Jul 21, 2023
b681100
fixed erroneous warning message
francoishamon Jul 24, 2023
fdbfbd1
bugfixes and checks
francoishamon Jul 25, 2023
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
20 changes: 11 additions & 9 deletions src/coreComponents/constitutive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ set( constitutive_headers
capillaryPressure/TableCapillaryPressure.hpp
capillaryPressure/TableCapillaryPressureHelpers.hpp
capillaryPressure/VanGenuchtenCapillaryPressure.hpp
capillaryPressure/capillaryPressureSelector.hpp
capillaryPressure/layouts.hpp
capillaryPressure/CapillaryPressureSelector.hpp
capillaryPressure/Layouts.hpp
contact/ContactBase.hpp
contact/CoulombContact.hpp
contact/ContactSelector.hpp
Expand Down Expand Up @@ -82,18 +82,19 @@ set( constitutive_headers
permeability/ProppantPermeability.hpp
permeability/SlipDependentPermeability.hpp
permeability/WillisRichardsPermeability.hpp
relativePermeability/RelpermDriver.hpp
relativePermeability/RelpermDriverRunTest.hpp
relativePermeability/BrooksCoreyBakerRelativePermeability.hpp
relativePermeability/BrooksCoreyRelativePermeability.hpp
relativePermeability/KilloughHysteresis.hpp
relativePermeability/RelativePermeabilityBase.hpp
relativePermeability/RelativePermeabilityFields.hpp
relativePermeability/RelativePermeabilityInterpolators.hpp
relativePermeability/RelpermDriver.hpp
relativePermeability/RelpermDriverRunTest.hpp
relativePermeability/TableRelativePermeability.hpp
relativePermeability/TableRelativePermeabilityHelpers.hpp
relativePermeability/TableRelativePermeabilityHysteresis.hpp
relativePermeability/VanGenuchtenBakerRelativePermeability.hpp
relativePermeability/layouts.hpp
relativePermeability/Layouts.hpp
relativePermeability/RelativePermeabilitySelector.hpp
solid/CompressibleSolid.hpp
solid/ProppantSolid.hpp
Expand Down Expand Up @@ -206,17 +207,18 @@ set( constitutive_sources
permeability/WillisRichardsPermeability.cpp
relativePermeability/BrooksCoreyBakerRelativePermeability.cpp
relativePermeability/BrooksCoreyRelativePermeability.cpp
relativePermeability/KilloughHysteresis.cpp
relativePermeability/RelativePermeabilityBase.cpp
relativePermeability/TableRelativePermeability.cpp
relativePermeability/TableRelativePermeabilityHelpers.cpp
relativePermeability/TableRelativePermeabilityHysteresis.cpp
relativePermeability/VanGenuchtenBakerRelativePermeability.cpp
relativePermeability/RelpermDriver.cpp
relativePermeability/RelpermDriverBrooksCoreyBakerRunTest.cpp
relativePermeability/RelpermDriverBrooksCoreyRunTest.cpp
relativePermeability/RelpermDriverVanGenuchtenBakerRunTest.cpp
relativePermeability/RelpermDriverTableRelativeRunTest.cpp
relativePermeability/RelpermDriverTableRelativeHysteresisRunTest.cpp
relativePermeability/TableRelativePermeability.cpp
relativePermeability/TableRelativePermeabilityHelpers.cpp
relativePermeability/TableRelativePermeabilityHysteresis.cpp
relativePermeability/VanGenuchtenBakerRelativePermeability.cpp
solid/CompressibleSolid.cpp
solid/CoupledSolidBase.cpp
solid/ProppantSolid.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "common/DataLayouts.hpp"
#include "constitutive/ConstitutiveBase.hpp"
#include "constitutive/capillaryPressure/layouts.hpp"
#include "constitutive/capillaryPressure/Layouts.hpp"
#include "common/GEOS_RAJA_Interface.hpp"

namespace geos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef GEOS_CONSTITUTIVE_CAPILLARYPRESSURE_CAPILLARYPRESSUREFIELDS_HPP_
#define GEOS_CONSTITUTIVE_CAPILLARYPRESSURE_CAPILLARYPRESSUREFIELDS_HPP_

#include "constitutive/capillaryPressure/layouts.hpp"
#include "constitutive/capillaryPressure/Layouts.hpp"
#include "mesh/MeshFields.hpp"

namespace geos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,29 @@ TableCapillaryPressureHelpers::validateCapillaryPressureTable( TableFunction con
}


void
TableCapillaryPressureHelpers::validateCapillaryPressureTable( geos::TableFunction const & capPresTable,
geos::string const & fullConstitutiveName,
bool const capPresMustBeIncreasing,
geos::real64 & phaseMax, geos::real64 & phaseMin )
{

TableCapillaryPressureHelpers::validateCapillaryPressureTable( capPresTable, fullConstitutiveName, capPresMustBeIncreasing );
ArrayOfArraysView< real64 const > coords = capPresTable.getCoordinates();
arraySlice1d< real64 const > phaseVolFrac = coords[0];
phaseMin = phaseVolFrac[0];
phaseMax = phaseVolFrac[phaseVolFrac.size()-1];
arrayView1d< real64 const > const capPres = capPresTable.getValues();
for( localIndex i = 1; i < coords.sizeOfArray( 0 ); ++i )
{
if( isZero( capPres[i-1] ) && !isZero( capPres[i] ) )
{
phaseMin = phaseVolFrac[i-1];
}
}
}


} // namespace constitutive

} // namespace geos
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ struct TableCapillaryPressureHelpers
string const & fullConstitutiveName,
bool const capPresMustBeIncreasing );


static
void validateCapillaryPressureTable( TableFunction const & capPresTable,
string const & fullConstitutiveName,
bool const capPresMustBeIncreasing,
real64 & phaseMax,
real64 & phaseMin );

};

} // namespace constitutive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,20 @@ class BrooksCoreyBakerRelativePermeability : public RelativePermeabilityBase
static constexpr char const * volFracScaleString() { return "volFracScale"; }
};

real64 getWettingPhaseMinVolumeFraction() const override
{
integer ipWetting;
std::tie( ipWetting, std::ignore ) = phaseIndex( getPhaseOrder());
return m_phaseMinVolumeFraction[ipWetting];
}

real64 getNonWettingMinVolumeFraction() const override
{
integer ipNonWetting;
std::tie( std::ignore, ipNonWetting ) = phaseIndex( getPhaseOrder());
return m_phaseMinVolumeFraction[ipNonWetting];
};

arrayView1d< real64 const > getPhaseMinVolumeFraction() const override { return m_phaseMinVolumeFraction; };

protected:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,19 @@ class BrooksCoreyRelativePermeability : public RelativePermeabilityBase
} vieKeysBrooksCoreyRelativePermeability;
//END_SPHINX_INCLUDE_01

arrayView1d< real64 const > getPhaseMinVolumeFraction() const override { return m_phaseMinVolumeFraction; };
real64 getWettingPhaseMinVolumeFraction() const override
{
integer ipWetting;
std::tie( ipWetting, std::ignore ) = phaseIndex( getPhaseOrder());
return m_phaseMinVolumeFraction[ipWetting];
}

real64 getNonWettingMinVolumeFraction() const override
{
integer ipNonWetting;
std::tie( std::ignore, ipNonWetting ) = phaseIndex( getPhaseOrder());
return m_phaseMinVolumeFraction[ipNonWetting];
};

protected:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* ------------------------------------------------------------------------------------------------------------
* SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2018-2020 TotalEnergies
* Copyright (c) 2019- GEOSX Contributors
* All rights reserved
*
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
* ------------------------------------------------------------------------------------------------------------
*/

/***
* @file KilloughHysteresis.hpp
*/

#include "KilloughHysteresis.hpp"


namespace geos
{

using namespace dataRepository;

namespace constitutive
{


void KilloughHysteresis::postProcessInput( real64 const & jerauldParam_a,
real64 const & jerauldParam_b,
real64 const & killoughCurvatureParamRelPerm )
{
GEOS_THROW_IF( jerauldParam_a < 0,
GEOS_FMT( "{}: the parameter {} must be positive",
catalogName(),
viewKeyStruct::jerauldParameterAString() ),
InputError );

GEOS_THROW_IF( jerauldParam_b < 0,
GEOS_FMT( "{}: the paramater {} must be postitive",
catalogName(),
viewKeyStruct::jerauldParameterBString() ),
InputError );

GEOS_THROW_IF( killoughCurvatureParamRelPerm < 0,
GEOS_FMT( "{}: the paramater {} must be postitive",
catalogName(),
viewKeyStruct::killoughCurvatureParameterString() ),
InputError );

}



} //end namespace

} //end namespace
Loading