Skip to content
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f9db9fd
1) new constraint schema, 2) resturcture well jac assem loops
tjb-ltk Sep 29, 2025
a9cd276
fix merge errors
tjb-ltk Sep 30, 2025
c59b1a6
fix integrate errors
tjb-ltk Sep 30, 2025
48aabd4
rel mode fix
tjb-ltk Sep 30, 2025
a85ee1d
1) remove old code, 2) test different constraint org, 3) singlephase …
tjb-ltk Oct 2, 2025
8366922
1) SinglePhaseWell adopts new constraint convention, 2) Change constr…
tjb-ltk Oct 7, 2025
4f49bf1
fix constraint sign and normalizers
tjb-ltk Oct 7, 2025
2e82b49
1) compositional_multiphase_wells_1d.xml matches geos branch, 2) sing…
tjb-ltk Oct 8, 2025
6281018
compressible_single_phase_wells_1d.xml matches geos branch
tjb-ltk Oct 9, 2025
205889f
improve naming conventions for well constriant files and classes
tjb-ltk Oct 13, 2025
b6ae5ef
fix reference to 'internal' is ambiguous error
tjb-ltk Oct 13, 2025
fa61ab1
1) well constraint schema script, 2) converted xmls, 3) Failed conver…
tjb-ltk Oct 14, 2025
0ba2377
well estimator dev
tjb-ltk Oct 14, 2025
292c90f
schema
tjb-ltk Oct 15, 2025
d4eb504
1)fixes for catalogue registration, 2) xml convert script still needs…
tjb-ltk Oct 16, 2025
bd3d0cf
fix liq rate schema
tjb-ltk Oct 20, 2025
723c2bc
Revert "1) well constraint schema script, 2) converted xmls, 3) Faile…
tjb-ltk Oct 21, 2025
e39ccf1
xml with new constraint schema, try 2
tjb-ltk Oct 23, 2025
d0fcf79
merge devel
tjb-ltk Oct 27, 2025
8b21d69
remove extra ;
tjb-ltk Oct 28, 2025
470a7ff
remove :
tjb-ltk Oct 28, 2025
b8a90f4
fix constraint schema, phase name on totalvol constraint not allowed
tjb-ltk Oct 28, 2025
94fc9ad
update well constraint schema
tjb-ltk Oct 29, 2025
17047bd
1) expose method for unit tests, 2) update unittests accordingly
tjb-ltk Oct 29, 2025
c6a349f
schema change
tjb-ltk Oct 29, 2025
1c03220
1) remove unused vars , add missing constriant type in selector
tjb-ltk Oct 29, 2025
b5f6c5d
reintroduce control keyword option to be consistent with previous in …
tjb-ltk Oct 30, 2025
c43657e
updated schema
tjb-ltk Oct 30, 2025
e78ef18
add back control keyword
tjb-ltk Oct 30, 2025
b000ed4
add control schema to unit tests
tjb-ltk Oct 30, 2025
a319e0e
uncrustify should be automated
tjb-ltk Oct 30, 2025
9b9ccc2
add control schema
tjb-ltk Oct 31, 2025
e656b84
...
tjb-ltk Nov 1, 2025
a8a4654
restart fix
tjb-ltk Nov 2, 2025
deebeb6
Merge branch 'develop' into feature/byer3/well_constraints
tjb-ltk Nov 3, 2025
5116adb
merge
tjb-ltk Nov 3, 2025
bfde8cf
Revert "merge"
tjb-ltk Nov 3, 2025
161631a
schema
tjb-ltk Nov 3, 2025
076c1b4
schema
tjb-ltk Nov 3, 2025
eb25cac
schema
tjb-ltk Nov 3, 2025
7ed7b8f
thermal test case prod runs ~25yrs, inj ~1yr
tjb-ltk Nov 3, 2025
12bbd4d
uncrustify
tjb-ltk Nov 3, 2025
6412344
merge from constraint branch
tjb-ltk Nov 3, 2025
44902df
missing from merge
tjb-ltk Nov 3, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ class ComponentMask
private:

/// Number of bits in mask storage
static constexpr int NUM_BITS = internal::roundToNextPowerOfTwo( MAX_COMP );
static constexpr int NUM_BITS = geos::internal::roundToNextPowerOfTwo( MAX_COMP );

/// Type used to represent the bit mask
using mask_t = typename internal::ComponentMaskType< NUM_BITS >::type;
using mask_t = typename geos::internal::ComponentMaskType< NUM_BITS >::type;

public:

Expand Down
18 changes: 18 additions & 0 deletions src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,21 @@ set( fluidFlowSolvers_headers
wells/SinglePhaseWellFields.hpp
wells/WellConstants.hpp
wells/WellControls.hpp
wells/WellConstraintsBase.hpp
wells/WellInjectionConstraint.hpp
wells/WellProductionConstraint.hpp
wells/WellBHPConstraints.hpp
wells/WellVolumeRateConstraint.hpp
wells/WellMassRateConstraint.hpp
wells/WellPhaseVolumeRateConstraint.hpp
wells/WellLiquidRateConstraint.hpp
wells/WellSolverBase.hpp
wells/WellSolverBaseFields.hpp
wells/LogLevelsInfo.hpp
wells/kernels/SinglePhaseWellKernels.hpp
wells/kernels/CompositionalMultiphaseWellKernels.hpp
wells/kernels/CompositionalMultiphaseWellConstraintKernels.hpp
wells/kernels/SinglePhaseWellConstraintKernels.hpp
proppantTransport/ProppantTransport.hpp
proppantTransport/ProppantTransportFields.hpp
proppantTransport/ProppantTransportKernels.hpp )
Expand Down Expand Up @@ -150,6 +160,14 @@ set( fluidFlowSolvers_sources
wells/SinglePhaseWell.cpp
wells/kernels/SinglePhaseWellKernels.cpp
wells/WellControls.cpp
wells/WellConstraintsBase.cpp
wells/WellInjectionConstraint.cpp
wells/WellProductionConstraint.cpp
wells/WellBHPConstraints.cpp
wells/WellVolumeRateConstraint.cpp
wells/WellMassRateConstraint.cpp
wells/WellPhaseVolumeRateConstraint.cpp
wells/WellLiquidRateConstraint.cpp
wells/WellSolverBase.cpp
proppantTransport/ProppantTransport.cpp
proppantTransport/ProppantTransportKernels.cpp )
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "physicsSolvers/fluidFlow/wells/WellSolverBase.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp"

#include "physicsSolvers/fluidFlow/wells/WellConstraintsBase.hpp"

namespace geos
{

Expand Down Expand Up @@ -92,24 +94,51 @@ class CompositionalMultiphaseWell : public WellSolverBase
/**@{*/


virtual real64
calculateWellResidualNorm( real64 const & time_n,
real64 const & dt,
WellElementSubRegion const & subRegion,
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs ) override;

virtual real64
calculateResidualNorm( real64 const & time_n,
real64 const & dt,
DomainPartition const & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localRhs ) override;

virtual real64
scalingForWellSystemSolution( ElementSubRegionBase & subRegion,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution ) override;

virtual real64
scalingForSystemSolution( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution ) override;

virtual bool
checkWellSystemSolution( ElementSubRegionBase & subRegion,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
real64 const scalingFactor ) override;

virtual bool
checkSystemSolution( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
real64 const scalingFactor ) override;

virtual void
applyWellSystemSolution( DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
real64 const scalingFactor,
real64 const dt,
DomainPartition & domain,
MeshLevel & mesh,
WellElementSubRegion & subRegion ) override;

virtual void
applySystemSolution( DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
Expand Down Expand Up @@ -159,6 +188,21 @@ class CompositionalMultiphaseWell : public WellSolverBase
*/
void updateFluidModel( WellElementSubRegion & subRegion );

/**
* @brief Update well separator using current values of pressure and composition at the reference element
* @param subRegion the well subregion containing all the primary and dependent fields
* @param targetIndex the targetIndex of the subRegion
*/
void updateSeparator( WellElementSubRegion & subRegion );

/**
* @brief Calculate well rates at reference element
* @param subRegion the well subregion containing all the primary and dependent fields
* @param targetIndex the targetIndex of the subRegion
*/

void calculateReferenceElementRates( WellElementSubRegion & subRegion );

/**
* @brief Recompute phase volume fractions (saturations) from constitutive and primary variables
* @param subRegion the well subregion containing all the primary and dependent fields
Expand All @@ -172,6 +216,16 @@ class CompositionalMultiphaseWell : public WellSolverBase
*/
void updateTotalMassDensity( WellElementSubRegion & subRegion ) const;

/**
* @brief Recompute the perforation rates for all the wells
* @param domain the domain containing the mesh and fields
*/
virtual void computeWellPerforationRates( real64 const & time_n,
real64 const & GEOS_UNUSED_PARAM( dt ),
ElementRegionManager const & elemManager,
WellElementSubRegion & subRegion )override;


/**
* @brief Recompute the perforation rates for all the wells
* @param domain the domain containing the mesh and fields
Expand All @@ -183,6 +237,7 @@ class CompositionalMultiphaseWell : public WellSolverBase
* @brief Recompute all dependent quantities from primary variables (including constitutive models)
* @param subRegion the well subregion containing all the primary and dependent fields
*/
virtual real64 updateWellState( WellElementSubRegion & subRegion ) override;
virtual void updateState( DomainPartition & domain ) override;

virtual real64 updateSubRegionState( WellElementSubRegion & subRegion ) override;
Expand All @@ -197,6 +252,13 @@ class CompositionalMultiphaseWell : public WellSolverBase

integer useTotalMassEquation() const { return m_useTotalMassEquation; }

virtual void assembleWellFluxTerms( real64 const & time,
real64 const & dt,
WellElementSubRegion const & subRegion,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;

/**
* @brief assembles the flux terms for all connections between well elements
* @param time_n previous time value
Expand All @@ -213,6 +275,14 @@ class CompositionalMultiphaseWell : public WellSolverBase
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs )override;

virtual void assembleWellAccumulationTerms( real64 const & time,
real64 const & dt,
WellElementSubRegion & subRegion,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;

/**
* @brief assembles the accumulation term for all the well elements
* @param domain the physical domain object
Expand All @@ -227,6 +297,21 @@ class CompositionalMultiphaseWell : public WellSolverBase
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;

virtual void assembleWellConstraintTerms( real64 const & time_n,
real64 const & dt,
WellElementSubRegion const & subRegion,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;


virtual void assembleWellPressureRelations( real64 const & time_n,
real64 const & dt,
WellElementSubRegion const & subRegion,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;

/**
* @brief assembles the pressure relations at all connections between well elements except at the well head
* @param time_n time at the beginning of the time step
Expand All @@ -249,6 +334,8 @@ class CompositionalMultiphaseWell : public WellSolverBase
*/
void chopNegativeDensities( DomainPartition & domain );

void chopNegativeDensities( WellElementSubRegion & subRegion );

struct viewKeyStruct : WellSolverBase::viewKeyStruct
{
static constexpr char const * dofFieldString() { return "compositionalWellVars"; }
Expand Down Expand Up @@ -312,6 +399,7 @@ class CompositionalMultiphaseWell : public WellSolverBase

virtual void initializePostInitialConditionsPreSubGroups() override;

void saveState( WellElementSubRegion & subRegion );
virtual void postRestartInitialization() override final;
/*
* @brief Utility function that checks the consistency of the constitutive models
Expand All @@ -330,11 +418,6 @@ class CompositionalMultiphaseWell : public WellSolverBase
void validateWellControlsForFluid( WellControls const & wellControls,
constitutive::MultiFluidBase const & fluid ) const;

/**
* @brief Checks injection streams for validity (compositions sum to one)
* @param subRegion the well subRegion
*/
void validateInjectionStreams( WellElementSubRegion const & subRegion ) const;

/**
* @brief Make sure that the well constraints are compatible
Expand All @@ -357,6 +440,9 @@ class CompositionalMultiphaseWell : public WellSolverBase
real64 const & dt,
DomainPartition & domain ) override;

virtual bool evaluateConstraints( real64 const & time_n,
WellElementSubRegion & subRegion ) override;

private:

/**
Expand All @@ -365,8 +451,23 @@ class CompositionalMultiphaseWell : public WellSolverBase
*/
void initializeWells( DomainPartition & domain, real64 const & time_n ) override;

void initializeWell( DomainPartition & domain, MeshLevel & mesh, WellElementSubRegion & subRegion, real64 const & time_n ) override;

virtual void setConstitutiveNames( ElementSubRegionBase & subRegion ) const override;

template< typename ... GROUPTYPES >
void selectLimitingConstraint( real64 const & time_n, integer const coupledIterationNumber, WellElementSubRegion & subRegion );

void solveConstraint( std::shared_ptr< WellConstraintBase > constraint,
real64 const & time_n,
real64 const & dt,
integer const cycleNumber,
integer const coupledIterationNumber,
DomainPartition & domain,
MeshLevel & mesh,
ElementRegionManager & elemManager,
WellElementSubRegion & subRegion,
DofManager const & dofManager );


/// flag indicating whether mass or molar formulation should be used
Expand Down
Loading
Loading