Skip to content

Conversation

@francoishamon
Copy link
Contributor

@francoishamon francoishamon commented Mar 17, 2022

This PR addresses this comment from @CusiniM. I prefer to address the comment in a separate PR mergeable before or after the thermal PR.

This PR moves the phase density, phase component fraction, phase internal energy, phase enthalpy evaluated at the previous time level (time n) to multifluid constitutive model, and add a method saveConvergedState to the MultiFluidBase class.

The PR does not introduce numerical diffs, but requires a rebaseline. Rebaseline done in https://github.com/GEOSX/integratedTests/pull/210

@francoishamon francoishamon added type: cleanup / refactor Non-functional change (NFC) flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests labels Mar 17, 2022
@francoishamon francoishamon requested a review from CusiniM March 17, 2022 01:19
@francoishamon francoishamon self-assigned this Mar 17, 2022
Comment on lines +213 to +216
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 );
Copy link
Contributor

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. 😉

Comment on lines +237 to +243
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];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we do not store the derivatives, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac_dCompDens = m_dPhaseVolFrac_dCompDens[ei];

arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseDensOld = m_phaseDensOld[ei];
arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDensOld = m_phaseDensOld[ei][0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this extra (dummy?) dimension? (The [0] at the end).
That bothers me here and there in the code.

Copy link
Collaborator

@CusiniM CusiniM Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because the second dimension contains the quadrature point index. The thing is that our flow kernels assume a single integration point since we use piece-wise constant functions for all our FV relevant quantities. We could loop over quadrature points and avoid hard-coding the value 0 but it would add an extra loop that in these kernels would not make much sense. The problem is that the same constitutive model can be used with a discretization scheme that does need that second dimension. Although, at least for now, that 's not true for fluid properties so maybe we could change the types of all those. It will make it inconsistent across fluid models though so I am not sure what's best.

@francoishamon francoishamon added ci: run CUDA builds Allows to triggers (costly) CUDA jobs and removed flag: ready for review labels Mar 25, 2022
@francoishamon francoishamon merged commit 877758e into develop Mar 25, 2022
@francoishamon francoishamon deleted the refactor/hamon/moveOldToConstitutive branch March 25, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: requires rebaseline Requires rebaseline branch in integratedTests type: cleanup / refactor Non-functional change (NFC)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants