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
c666ea8b
Commit
c666ea8b
authored
8 years ago
by
Thomas Fetzer
Browse files
Options
Downloads
Patches
Plain Diff
[material] Add molarMass function and default values to component/constant
parent
84efd446
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!145
[material] Add molarMass function and default values to component/constant.hh
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/material/components/constant.hh
+33
-4
33 additions, 4 deletions
dumux/material/components/constant.hh
with
33 additions
and
4 deletions
dumux/material/components/constant.hh
+
33
−
4
View file @
c666ea8b
...
...
@@ -25,11 +25,30 @@
#define DUMUX_CONSTANT_HH
#include
<dumux/common/parameters.hh>
#include
<dumux/common/basicproperties.hh>
#include
"component.hh"
namespace
Dumux
{
namespace
Properties
{
// forward declaration of the needed properties
NEW_PROP_TAG
(
ProblemMolarMass
);
NEW_PROP_TAG
(
ProblemLiquidDensity
);
NEW_PROP_TAG
(
ProblemLiquidKinematicViscosity
);
NEW_PROP_TAG
(
ProblemGasDensity
);
NEW_PROP_TAG
(
ProblemGasKinematicViscosity
);
// set default values
SET_SCALAR_PROP
(
NumericModel
,
ProblemMolarMass
,
1.0
);
SET_SCALAR_PROP
(
NumericModel
,
ProblemLiquidDensity
,
1.0
);
SET_SCALAR_PROP
(
NumericModel
,
ProblemLiquidKinematicViscosity
,
1.0
);
SET_SCALAR_PROP
(
NumericModel
,
ProblemGasDensity
,
1.0
);
SET_SCALAR_PROP
(
NumericModel
,
ProblemGasKinematicViscosity
,
1.0
);
}
// end namespace Properties
/*!
* \ingroup Components
*
...
...
@@ -49,6 +68,16 @@ public:
static
const
char
*
name
()
{
return
"Constant"
;
}
/*!
* \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component.
*/
static
Scalar
molarMass
()
{
static
const
Scalar
molarMass
=
GET_PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
MolarMass
);
return
molarMass
;
}
/*!
* \brief Returns true if the liquid phase is assumed to be compressible
*/
...
...
@@ -64,7 +93,7 @@ public:
static
Scalar
liquidDensity
(
Scalar
temperature
,
Scalar
pressure
)
{
static
const
Scalar
density
=
GET_
RUNTIME_
PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
LiquidDensity
);
=
GET_PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
LiquidDensity
);
return
density
;
}
...
...
@@ -80,7 +109,7 @@ public:
static
Scalar
liquidViscosity
(
Scalar
temperature
,
Scalar
pressure
)
{
static
const
Scalar
kinematicViscosity
=
GET_
RUNTIME_
PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
LiquidKinematicViscosity
);
=
GET_PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
LiquidKinematicViscosity
);
return
kinematicViscosity
*
liquidDensity
(
temperature
,
pressure
);
}
...
...
@@ -100,7 +129,7 @@ public:
static
Scalar
gasDensity
(
Scalar
temperature
,
Scalar
pressure
)
{
static
const
Scalar
density
=
GET_
RUNTIME_
PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
GasDensity
);
=
GET_PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
GasDensity
);
return
density
;
}
...
...
@@ -116,7 +145,7 @@ public:
static
Scalar
gasViscosity
(
Scalar
temperature
,
Scalar
pressure
)
{
static
const
Scalar
kinematicViscosity
=
GET_
RUNTIME_
PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
GasKinematicViscosity
);
=
GET_PARAM_FROM_GROUP
(
TypeTag
,
Scalar
,
Problem
,
GasKinematicViscosity
);
return
kinematicViscosity
*
gasDensity
(
temperature
,
pressure
);
}
};
...
...
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