mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3079 from totto82/testDiff
FOR TESTING. Enable Diffusion by default
This commit is contained in:
@@ -324,6 +324,12 @@ struct EnableGravity<TypeTag, TTag::EclBaseProblem> {
|
|||||||
static constexpr bool value = true;
|
static constexpr bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Enable diffusion
|
||||||
|
template<class TypeTag>
|
||||||
|
struct EnableDiffusion<TypeTag, TTag::EclBaseProblem> {
|
||||||
|
static constexpr bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
// only write the solutions for the report steps to disk
|
// only write the solutions for the report steps to disk
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct EnableWriteAllSolutions<TypeTag, TTag::EclBaseProblem> {
|
struct EnableWriteAllSolutions<TypeTag, TTag::EclBaseProblem> {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
|
|
||||||
// get the ntg values, the ntg values are modified for the cells merged with minpv
|
// get the ntg values, the ntg values are modified for the cells merged with minpv
|
||||||
const std::vector<double>& ntg = eclState.fieldProps().get_double("NTG");
|
const std::vector<double>& ntg = eclState.fieldProps().get_double("NTG");
|
||||||
|
const bool updateDiffusivity = eclState.getSimulationConfig().isDiffusive() && enableDiffusion;
|
||||||
unsigned numElements = elemMapper.size();
|
unsigned numElements = elemMapper.size();
|
||||||
|
|
||||||
extractPermeability_();
|
extractPermeability_();
|
||||||
@@ -183,7 +183,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if diffusion is enabled, let's do the same for the "diffusivity"
|
// if diffusion is enabled, let's do the same for the "diffusivity"
|
||||||
if (enableDiffusion) {
|
if (updateDiffusivity) {
|
||||||
diffusivity_->clear();
|
diffusivity_->clear();
|
||||||
diffusivity_->reserve(numElements*3*1.05);
|
diffusivity_->reserve(numElements*3*1.05);
|
||||||
extractPorosity_();
|
extractPorosity_();
|
||||||
@@ -396,7 +396,7 @@ public:
|
|||||||
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
||||||
|
|
||||||
// update the "thermal half transmissibility" for the intersection
|
// update the "thermal half transmissibility" for the intersection
|
||||||
if (enableDiffusion) {
|
if (updateDiffusivity) {
|
||||||
|
|
||||||
Scalar halfDiffusivity1;
|
Scalar halfDiffusivity1;
|
||||||
Scalar halfDiffusivity2;
|
Scalar halfDiffusivity2;
|
||||||
@@ -498,7 +498,13 @@ public:
|
|||||||
* \brief Return the diffusivity for the intersection between two elements.
|
* \brief Return the diffusivity for the intersection between two elements.
|
||||||
*/
|
*/
|
||||||
Scalar diffusivity(unsigned elemIdx1, unsigned elemIdx2) const
|
Scalar diffusivity(unsigned elemIdx1, unsigned elemIdx2) const
|
||||||
{ return diffusivity_->at(isId_(elemIdx1, elemIdx2)); }
|
{
|
||||||
|
if(diffusivity_->empty())
|
||||||
|
return 0.0;
|
||||||
|
|
||||||
|
return diffusivity_->at(isId_(elemIdx1, elemIdx2));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user