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
5b01d89a
Commit
5b01d89a
authored
3 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[PNM] Add diffusive enthalpy transport
parent
9d46fcf1
No related branches found
No related tags found
1 merge request
!2568
[pnm] Various imrprovements
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dumux/flux/porenetwork/fourierslaw.hh
+43
-0
43 additions, 0 deletions
dumux/flux/porenetwork/fourierslaw.hh
dumux/porenetwork/1pnc/model.hh
+7
-0
7 additions, 0 deletions
dumux/porenetwork/1pnc/model.hh
dumux/porenetwork/properties.hh
+1
-1
1 addition, 1 deletion
dumux/porenetwork/properties.hh
with
51 additions
and
1 deletion
dumux/flux/porenetwork/fourierslaw.hh
+
43
−
0
View file @
5b01d89a
...
...
@@ -26,13 +26,22 @@
#define DUMUX_FLUX_PNM_FOURIERS_LAW_HH
#include
<dumux/common/math.hh>
#include
<dumux/flux/referencesystemformulation.hh>
#include
<type_traits>
namespace
Dumux
::
PoreNetwork
{
namespace
Detail
{
struct
NoDiffusionType
{};
}
// end namespace Detail
/*!
* \ingroup PoreNetworkModels
* \brief Specialization of Fourier's Law for the pore-network model.
*/
template
<
class
MolecularDiffusionType
=
Detail
::
NoDiffusionType
>
struct
PNMFouriersLaw
{
...
...
@@ -68,7 +77,41 @@ struct PNMFouriersLaw
const
Scalar
gradT
=
deltaT
/
fluxVarsCache
.
throatLength
();
heatflux
+=
thermalConductivity
*
gradT
*
area
;
if
constexpr
(
!
std
::
is_same_v
<
MolecularDiffusionType
,
Detail
::
NoDiffusionType
>
)
heatflux
+=
componentEnthalpyFlux_
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scvf
,
elemFluxVarsCache
,
phaseIdx
);
}
return
heatflux
;
}
private
:
template
<
class
Problem
,
class
Element
,
class
FVElementGeometry
,
class
ElementVolumeVariables
,
class
ElementFluxVariablesCache
>
static
auto
componentEnthalpyFlux_
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
typename
FVElementGeometry
::
SubControlVolumeFace
&
scvf
,
const
ElementFluxVariablesCache
&
elemFluxVarsCache
,
const
int
phaseIdx
)
{
using
Scalar
=
typename
ElementVolumeVariables
::
VolumeVariables
::
PrimaryVariables
::
value_type
;
Scalar
heatflux
=
0.0
;
using
FluidSystem
=
typename
ElementVolumeVariables
::
VolumeVariables
::
FluidSystem
;
const
auto
diffusiveFlux
=
MolecularDiffusionType
::
flux
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scvf
,
phaseIdx
,
elemFluxVarsCache
);
for
(
int
compIdx
=
0
;
compIdx
<
ElementVolumeVariables
::
VolumeVariables
::
numFluidComponents
();
++
compIdx
)
{
const
bool
insideIsUpstream
=
diffusiveFlux
[
compIdx
]
>
0.0
;
const
auto
&
upstreamVolVars
=
insideIsUpstream
?
elemVolVars
[
scvf
.
insideScvIdx
()]
:
elemVolVars
[
scvf
.
outsideScvIdx
()];
const
Scalar
componentEnthalpy
=
FluidSystem
::
componentEnthalpy
(
upstreamVolVars
.
fluidState
(),
phaseIdx
,
compIdx
);
if
(
MolecularDiffusionType
::
referenceSystemFormulation
()
==
ReferenceSystemFormulation
::
massAveraged
)
heatflux
+=
diffusiveFlux
[
compIdx
]
*
componentEnthalpy
;
else
heatflux
+=
diffusiveFlux
[
compIdx
]
*
FluidSystem
::
molarMass
(
compIdx
)
*
componentEnthalpy
;
}
return
heatflux
;
}
};
...
...
This diff is collapsed.
Click to expand it.
dumux/porenetwork/1pnc/model.hh
+
7
−
0
View file @
5b01d89a
...
...
@@ -242,5 +242,12 @@ struct ThermalConductivityModel<TypeTag, TTag::PNMOnePNCNI>
using
type
=
ThermalConductivityAverage
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
};
//!< Use the average for effective conductivities
// template<class TypeTag>
// struct HeatConductionType<TypeTag, TTag::PNMOnePNCNI>
// {
// TODO uncomment this as soon as there is a generalized approach for component enthalpies in all fluid systems
// using type = Dumux::PoreNetwork::PNMFouriersLaw<GetPropType<TypeTag, MolecularDiffusionType>>;
// }; //!< Use Fourier's law and also consider enthalpy transport by molecular diffusion
}
// end namespace Dumux::Properties
#endif
This diff is collapsed.
Click to expand it.
dumux/porenetwork/properties.hh
+
1
−
1
View file @
5b01d89a
...
...
@@ -68,7 +68,7 @@ public:
};
template
<
class
TypeTag
>
struct
HeatConductionType
<
TypeTag
,
TTag
::
PoreNetworkModel
>
{
using
type
=
Dumux
::
PoreNetwork
::
PNMFouriersLaw
;
};
struct
HeatConductionType
<
TypeTag
,
TTag
::
PoreNetworkModel
>
{
using
type
=
Dumux
::
PoreNetwork
::
PNMFouriersLaw
<>
;
};
//! The labels
template
<
class
TypeTag
>
...
...
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