Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux-course
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-course
Commits
01dc15c4
Commit
01dc15c4
authored
6 years ago
by
Beatrix Becker
Browse files
Options
Downloads
Patches
Plain Diff
[exercise fluidsystem][2pproblem] add logarithmic spacing and get density from fluidsystem directly
parent
d82bdbfe
No related branches found
No related tags found
1 merge request
!21
Feature/exercise fluidsystem gnuplot
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercises/exercise-fluidsystem/2pproblem.hh
+20
-9
20 additions, 9 deletions
exercises/exercise-fluidsystem/2pproblem.hh
with
20 additions
and
9 deletions
exercises/exercise-fluidsystem/2pproblem.hh
+
20
−
9
View file @
01dc15c4
...
...
@@ -132,6 +132,7 @@ class ExerciseFluidsystemProblemTwoP : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
using
FluidState
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidState
);
enum
{
waterPressureIdx
=
Indices
::
pressureIdx
,
...
...
@@ -289,20 +290,30 @@ public:
private
:
void
plotDensity_
()
{
std
::
vector
<
double
>
x
(
100
);
std
::
vector
<
double
>
y
(
100
);
for
(
int
i
=
0
;
i
<
100
;
++
i
)
x
[
i
]
=
1e4
+
i
*
100910
;
for
(
int
i
=
0
;
i
<
100
;
++
i
)
y
[
i
]
=
MyCompressibleComponent
<
Scalar
>::
liquidDensity
(
300
,
x
[
i
]);
FluidState
fluidState
;
fluidState
.
setTemperature
(
temperature
());
int
numberOfPoints
=
100
;
Scalar
xMin
=
1e4
;
Scalar
xMax
=
1e7
;
Scalar
spacing
=
std
::
pow
((
xMax
/
xMin
),
1.0
/
(
numberOfPoints
-
1
));
std
::
vector
<
double
>
x
(
numberOfPoints
);
std
::
vector
<
double
>
y
(
numberOfPoints
);
for
(
int
i
=
0
;
i
<
numberOfPoints
;
++
i
)
x
[
i
]
=
xMin
*
std
::
pow
(
spacing
,
i
);
for
(
int
i
=
0
;
i
<
numberOfPoints
;
++
i
)
{
fluidState
.
setPressure
(
FluidSystem
::
phase1Idx
,
x
[
i
]);
y
[
i
]
=
FluidSystem
::
density
(
fluidState
,
FluidSystem
::
phase1Idx
);
}
gnuplot_
.
resetPlot
();
gnuplot_
.
setXRange
(
1e4
,
1e7
);
gnuplot_
.
setXRange
(
xMin
,
xMax
);
gnuplot_
.
setOption
(
"set logscale x 10"
);
gnuplot_
.
setOption
(
"set key left top"
);
gnuplot_
.
setYRange
(
1440
,
1480
);
gnuplot_
.
setXlabel
(
"pressure [Pa]"
);
gnuplot_
.
setYlabel
(
"density [kg/m^3]"
);
gnuplot_
.
addDataSetToPlot
(
x
,
y
,
"YourComponent_density.dat"
,
"w l t '
Liquid density
of your component'"
);
gnuplot_
.
plot
(
"YourComponent_density"
);
gnuplot_
.
addDataSetToPlot
(
x
,
y
,
"YourComponent
Phase
_density.dat"
,
"w l t '
Phase consisting
of your component'"
);
gnuplot_
.
plot
(
"YourComponent
Phase
_density"
);
}
Scalar
eps_
;
//! small epsilon value
...
...
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