Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
21fa837b
Commit
21fa837b
authored
8 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[richards] Remove untransparent regularization leading to false pn output
parent
9d4bde5a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!617
[WIP] Next
,
!360
Improve Richards model - Add RichardsNC model
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/porousmediumflow/richards/implicit/volumevariables.hh
+23
-19
23 additions, 19 deletions
dumux/porousmediumflow/richards/implicit/volumevariables.hh
with
23 additions
and
19 deletions
dumux/porousmediumflow/richards/implicit/volumevariables.hh
+
23
−
19
View file @
21fa837b
...
@@ -87,7 +87,10 @@ public:
...
@@ -87,7 +87,10 @@ public:
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
relativePermeabilityWetting_
=
MaterialLaw
::
krw
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
));
relativePermeabilityWetting_
=
MaterialLaw
::
krw
(
materialParams
,
fluidState_
.
saturation
(
wPhaseIdx
));
pnRef_
=
problem
.
nonWettingReferencePressure
();
//! precompute the minimum capillary pressure (entry pressure)
minPc_
=
MaterialLaw
::
pc
(
materialParams
,
/*Sw=*/
1.0
);
pn_
=
problem
.
nonWettingReferencePressure
();
porosity_
=
problem
.
spatialParams
().
porosity
(
element
,
scv
,
elemSol
);
porosity_
=
problem
.
spatialParams
().
porosity
(
element
,
scv
,
elemSol
);
permeability_
=
problem
.
spatialParams
().
permeability
(
element
,
scv
,
elemSol
);
permeability_
=
problem
.
spatialParams
().
permeability
(
element
,
scv
,
elemSol
);
}
}
...
@@ -107,21 +110,19 @@ public:
...
@@ -107,21 +110,19 @@ public:
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
);
const
Scalar
minPc
=
MaterialLaw
::
pc
(
materialParams
,
1.0
);
// set the wetting pressure
fluidState
.
setPressure
(
wPhaseIdx
,
priVars
[
pressureIdx
]);
fluidState
.
setPressure
(
wPhaseIdx
,
priVars
[
pressureIdx
]);
using
std
::
max
;
// compute the capillary pressure to compute the saturation
pn_
=
max
(
problem
.
nonWettingReferencePressure
(),
priVars
[
pressureIdx
]
+
minPc
);
// the material law takes care of cases where pc gets negative
const
Scalar
pc
=
problem
.
nonWettingReferencePressure
()
-
fluidState
.
pressure
(
wPhaseIdx
);
// saturations
const
Scalar
sw
=
MaterialLaw
::
sw
(
materialParams
,
pc
);
const
Scalar
sw
=
MaterialLaw
::
sw
(
materialParams
,
pn_
-
fluidState
.
pressure
(
wPhaseIdx
));
fluidState
.
setSaturation
(
wPhaseIdx
,
sw
);
fluidState
.
setSaturation
(
wPhaseIdx
,
sw
);
// density and viscosity
// density and viscosity
typename
FluidSystem
::
ParameterCache
paramCache
;
typename
FluidSystem
::
ParameterCache
paramCache
;
paramCache
.
updateAll
(
fluidState
);
paramCache
.
updateAll
(
fluidState
);
fluidState
.
setDensity
(
wPhaseIdx
,
FluidSystem
::
density
(
fluidState
,
paramCache
,
wPhaseIdx
));
fluidState
.
setDensity
(
wPhaseIdx
,
FluidSystem
::
density
(
fluidState
,
paramCache
,
wPhaseIdx
));
fluidState
.
setViscosity
(
wPhaseIdx
,
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
wPhaseIdx
));
fluidState
.
setViscosity
(
wPhaseIdx
,
FluidSystem
::
viscosity
(
fluidState
,
paramCache
,
wPhaseIdx
));
// compute and set the enthalpy
// compute and set the enthalpy
...
@@ -232,9 +233,15 @@ public:
...
@@ -232,9 +233,15 @@ public:
* The capillary pressure is defined as the difference in
* The capillary pressure is defined as the difference in
* pressures of the non-wetting and the wetting phase, i.e.
* pressures of the non-wetting and the wetting phase, i.e.
* \f[ p_c = p_n - p_w \f]
* \f[ p_c = p_n - p_w \f]
*
* \note Capillary pressures are always larger than the entry pressure
* This regularization doesn't affect the residual in which pc is not needed.
*/
*/
Scalar
capillaryPressure
()
const
Scalar
capillaryPressure
()
const
{
return
pn_
-
fluidState_
.
pressure
(
wPhaseIdx
);
}
{
using
std
::
max
;
return
max
(
minPc_
,
pn_
-
fluidState_
.
pressure
(
wPhaseIdx
));
}
/*!
/*!
* \brief Returns the pressureHead \f$\mathrm{[cm]}\f$ of a given phase within
* \brief Returns the pressureHead \f$\mathrm{[cm]}\f$ of a given phase within
...
@@ -251,7 +258,7 @@ public:
...
@@ -251,7 +258,7 @@ public:
* or the gravity different
* or the gravity different
*/
*/
Scalar
pressureHead
(
const
int
phaseIdx
)
const
Scalar
pressureHead
(
const
int
phaseIdx
)
const
{
return
100.0
*
(
pressure
(
phaseIdx
)
-
pn
Ref
_
)
/
density
(
phaseIdx
)
/
9.81
;
}
{
return
100.0
*
(
pressure
(
phaseIdx
)
-
pn_
)
/
density
(
phaseIdx
)
/
9.81
;
}
/*!
/*!
* \brief Returns the water content
* \brief Returns the water content
...
@@ -268,12 +275,12 @@ public:
...
@@ -268,12 +275,12 @@ public:
{
return
saturation
(
phaseIdx
)
*
porosity_
;
}
{
return
saturation
(
phaseIdx
)
*
porosity_
;
}
protected
:
protected
:
FluidState
fluidState_
;
FluidState
fluidState_
;
//! the fluid state
Scalar
relativePermeabilityWetting_
;
Scalar
relativePermeabilityWetting_
;
//! the relative permeability of the wetting phase
Scalar
porosity_
;
Scalar
porosity_
;
//! the porosity
PermeabilityType
permeability_
;
PermeabilityType
permeability_
;
//! the instrinsic permeability
Scalar
pn
Ref_
;
Scalar
pn
_
;
//! the reference non-wetting pressure
static
Sca
lar
p
n_
;
Scalar
minPc_
;
//! the minimum capil
lar
y
p
ressure (entry pressure)
private
:
private
:
Implementation
&
asImp_
()
Implementation
&
asImp_
()
...
@@ -283,9 +290,6 @@ private:
...
@@ -283,9 +290,6 @@ private:
{
return
*
static_cast
<
const
Implementation
*>
(
this
);
}
{
return
*
static_cast
<
const
Implementation
*>
(
this
);
}
};
};
template
<
class
TypeTag
>
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
)
RichardsVolumeVariables
<
TypeTag
>::
pn_
;
}
// end namespace Dumux
}
// end namespace Dumux
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment