-
Notifications
You must be signed in to change notification settings - Fork 99
Moved fluid variables at time n to multifluid constitutive model #1827
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
835eadb
moved old variables to multifluid constitutive model
francoishamon d7492b3
Merge branch 'develop' into refactor/hamon/moveOldToConstitutive
francoishamon 0bfcafb
Merge branch 'develop' into refactor/hamon/moveOldToConstitutive
francoishamon 6d472b4
fixed compilation
francoishamon 4a043cf
Merge branch 'develop' into refactor/hamon/moveOldToConstitutive
francoishamon b547abe
updated integratedTests submodule
francoishamon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule integratedTests
updated
from d79950 to 4bbb2f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) | |
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseFraction{}, &m_phaseFraction.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseDensity{}, &m_phaseDensity.value ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseDensityOld{}, &m_phaseDensityOld ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseDensity{}, &m_phaseDensity.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseMassDensity{}, &m_phaseMassDensity.value ); | ||
|
|
@@ -63,15 +64,19 @@ MultiFluidBase::MultiFluidBase( string const & name, Group * const parent ) | |
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseViscosity{}, &m_phaseViscosity.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseEnthalpy{}, &m_phaseEnthalpy.value ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseEnthalpyOld{}, &m_phaseEnthalpyOld ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseEnthalpy{}, &m_phaseEnthalpy.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseInternalEnergy{}, &m_phaseInternalEnergy.value ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseInternalEnergyOld{}, &m_phaseInternalEnergyOld ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseInternalEnergy{}, &m_phaseInternalEnergy.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseCompFraction{}, &m_phaseCompFraction.value ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::phaseCompFractionOld{}, &m_phaseCompFractionOld ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::dPhaseCompFraction{}, &m_phaseCompFraction.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::totalDensity{}, &m_totalDensity.value ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::totalDensityOld{}, &m_totalDensityOld ); | ||
| registerExtrinsicData( extrinsicMeshData::multifluid::dTotalDensity{}, &m_totalDensity.derivs ); | ||
|
|
||
| registerExtrinsicData( extrinsicMeshData::multifluid::initialTotalMassDensity{}, &m_initialTotalMassDensity ); | ||
|
|
@@ -88,6 +93,7 @@ void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPt | |
| m_phaseFraction.derivs.resize( size, numPts, numPhase, numDof ); | ||
|
|
||
| m_phaseDensity.value.resize( size, numPts, numPhase ); | ||
| m_phaseDensityOld.resize( size, numPts, numPhase ); | ||
| m_phaseDensity.derivs.resize( size, numPts, numPhase, numDof ); | ||
|
|
||
| m_phaseMassDensity.value.resize( size, numPts, numPhase ); | ||
|
|
@@ -97,15 +103,19 @@ void MultiFluidBase::resizeFields( localIndex const size, localIndex const numPt | |
| m_phaseViscosity.derivs.resize( size, numPts, numPhase, numDof ); | ||
|
|
||
| m_phaseEnthalpy.value.resize( size, numPts, numPhase ); | ||
| m_phaseEnthalpyOld.resize( size, numPts, numPhase ); | ||
| m_phaseEnthalpy.derivs.resize( size, numPts, numPhase, numDof ); | ||
|
|
||
| m_phaseInternalEnergy.value.resize( size, numPts, numPhase ); | ||
| m_phaseInternalEnergyOld.resize( size, numPts, numPhase ); | ||
| m_phaseInternalEnergy.derivs.resize( size, numPts, numPhase, numDof ); | ||
|
|
||
| m_phaseCompFraction.value.resize( size, numPts, numPhase, numComp ); | ||
| m_phaseCompFractionOld.resize( size, numPts, numPhase, numComp ); | ||
| m_phaseCompFraction.derivs.resize( size, numPts, numPhase, numComp, numDof ); | ||
|
|
||
| m_totalDensity.value.resize( size, numPts ); | ||
| m_totalDensityOld.resize( size, numPts ); | ||
| m_totalDensity.derivs.resize( size, numPts, numDof ); | ||
|
|
||
| m_initialTotalMassDensity.resize( size, numPts ); | ||
|
|
@@ -193,8 +203,52 @@ void MultiFluidBase::initializeState( arrayView2d< real64 const, compflow::USD_P | |
| } | ||
| } | ||
| } ); | ||
|
|
||
| // initialize the "old" variables | ||
| saveConvergedState(); | ||
| } | ||
|
|
||
| void MultiFluidBase::saveConvergedState() const | ||
| { | ||
| localIndex const numElem = m_initialTotalMassDensity.size( 0 ); | ||
| localIndex const numGauss = m_initialTotalMassDensity.size( 1 ); | ||
| integer const numPhase = m_phaseMassDensity.value.size( 2 ); | ||
| integer const numComp = m_phaseCompFraction.value.size( 3 ); | ||
|
|
||
| FluidProp::ViewTypeConst const totalDensity = m_totalDensity.toViewConst(); | ||
| PhaseProp::ViewTypeConst const phaseDensity = m_phaseDensity.toViewConst(); | ||
| PhaseProp::ViewTypeConst const phaseEnthalpy = m_phaseEnthalpy.toViewConst(); | ||
| PhaseProp::ViewTypeConst const phaseInternalEnergy = m_phaseInternalEnergy.toViewConst(); | ||
| PhaseComp::ViewTypeConst const phaseCompFraction = m_phaseCompFraction.toViewConst(); | ||
|
|
||
| arrayView2d< real64, multifluid::USD_FLUID > const totalDensityOld = m_totalDensityOld.toView(); | ||
| arrayView3d< real64, multifluid::USD_PHASE > const phaseDensityOld = m_phaseDensityOld.toView(); | ||
| arrayView3d< real64, multifluid::USD_PHASE > const phaseEnthalpyOld = m_phaseEnthalpyOld.toView(); | ||
| arrayView3d< real64, multifluid::USD_PHASE > const phaseInternalEnergyOld = m_phaseInternalEnergyOld.toView(); | ||
| arrayView4d< real64, multifluid::USD_PHASE_COMP > const phaseCompFractionOld = m_phaseCompFractionOld.toView(); | ||
|
|
||
| forAll< parallelDevicePolicy<> >( numElem, [=] GEOSX_HOST_DEVICE ( localIndex const k ) | ||
| { | ||
| for( localIndex q = 0; q < numGauss; ++q ) | ||
| { | ||
| totalDensityOld[k][q] = totalDensity.value[k][q]; | ||
| for( integer ip = 0; ip < numPhase; ++ip ) | ||
| { | ||
| phaseDensityOld[k][q][ip] = phaseDensity.value[k][q][ip]; | ||
| phaseEnthalpyOld[k][q][ip] = phaseEnthalpy.value[k][q][ip]; | ||
| phaseInternalEnergyOld[k][q][ip] = phaseInternalEnergy.value[k][q][ip]; | ||
| for( integer ic = 0; ic < numComp; ++ic ) | ||
| { | ||
| phaseCompFractionOld[k][q][ip][ic] = phaseCompFraction.value[k][q][ip][ic]; | ||
| } | ||
|
Comment on lines
+237
to
+243
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we do not store the derivatives, right?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, for the quantities at the previous time-step we only need the value non its derivatives. |
||
| } | ||
| } | ||
| } ); | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
| } // namespace constitutive | ||
|
|
||
| } // namespace geosx | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some day we can get rid of these hard coded indices. 😉