Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Mojtaba Abdolkhani
ogs
Commits
c63e5712
Commit
c63e5712
authored
8 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[FL] Moved several members of WaterViscosityIAPWS to its cpp file
parent
980c727a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.cpp
+29
-23
29 additions, 23 deletions
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.cpp
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.h
+1
-15
1 addition, 15 deletions
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.h
with
30 additions
and
38 deletions
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.cpp
+
29
−
23
View file @
c63e5712
...
...
@@ -18,9 +18,8 @@ namespace MaterialLib
{
namespace
Fluid
{
const
double
WaterViscosityIAPWS
::
_hi
[
4
]
=
{
1.67752
,
2.20462
,
0.6366564
,
-
0.241605
};
const
double
WaterViscosityIAPWS
::
_hij
[
6
][
7
]
=
{
static
const
double
Hi
[
4
]
=
{
1.67752
,
2.20462
,
0.6366564
,
-
0.241605
};
static
const
double
Hij
[
6
][
7
]
=
{
{
0.520094
,
0.222531
,
-
0.281378
,
0.161913
,
-
0.0325372
,
0
,
0
},
{
0.0850895
,
0.999115
,
-
0.906851
,
0.257399
,
0
,
0
,
0
},
{
-
1.08374
,
1.88797
,
-
0.772479
,
0
,
0
,
0
,
0
},
...
...
@@ -28,6 +27,16 @@ const double WaterViscosityIAPWS::_hij[6][7] = {
{
0
,
0
,
-
0.25704
,
0
,
0
,
0.00872102
,
0
},
{
0
,
0.120573
,
0
,
0
,
0
,
0
,
-
0.000593264
}};
static
double
computeBarMu0Factor
(
const
double
barT
);
static
double
series_factorT
[
6
];
static
double
series_factorRho
[
7
];
static
void
computeSeriesFactorForMu1
(
const
double
barT
,
const
double
bar_rho
);
static
double
computeBarMu1Factor
();
static
double
computedBarMu_dbarT
(
const
double
barT
,
double
bar_rho
);
static
double
computedBarMu_dbarRho
(
const
double
barT
,
double
bar_rho
);
double
WaterViscosityIAPWS
::
getValue
(
const
ArrayType
&
var_vals
)
const
{
const
double
bar_T
=
...
...
@@ -63,36 +72,35 @@ double WaterViscosityIAPWS::getdValue(const ArrayType& var_vals,
}
}
double
WaterViscosityIAPWS
::
computeBarMu0Factor
(
const
double
barT
)
const
double
computeBarMu0Factor
(
const
double
barT
)
{
double
sum_val
=
0.
;
double
barT_i
=
1.
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
sum_val
+=
(
_h
i
[
i
]
/
barT_i
);
sum_val
+=
(
H
i
[
i
]
/
barT_i
);
barT_i
*=
barT
;
}
return
sum_val
;
}
void
WaterViscosityIAPWS
::
computeSeriesFactorForMu1
(
const
double
barT
,
const
double
bar_rho
)
const
void
computeSeriesFactorForMu1
(
const
double
barT
,
const
double
bar_rho
)
{
_
series_factorT
[
0
]
=
1.
;
series_factorT
[
0
]
=
1.
;
const
double
barT_fac
=
1
/
barT
-
1.0
;
for
(
int
i
=
1
;
i
<
6
;
i
++
)
{
_
series_factorT
[
i
]
=
_
series_factorT
[
i
-
1
]
*
barT_fac
;
series_factorT
[
i
]
=
series_factorT
[
i
-
1
]
*
barT_fac
;
}
_
series_factorRho
[
0
]
=
1.
;
series_factorRho
[
0
]
=
1.
;
for
(
int
i
=
1
;
i
<
7
;
i
++
)
{
_
series_factorRho
[
i
]
=
_
series_factorRho
[
i
-
1
]
*
(
bar_rho
-
1.0
);
series_factorRho
[
i
]
=
series_factorRho
[
i
-
1
]
*
(
bar_rho
-
1.0
);
}
}
double
WaterViscosityIAPWS
::
computeBarMu1Factor
()
const
double
computeBarMu1Factor
()
{
double
sum_val
=
0.
;
for
(
int
i
=
0
;
i
<
6
;
i
++
)
...
...
@@ -100,16 +108,15 @@ double WaterViscosityIAPWS::computeBarMu1Factor() const
double
sum_val_j
=
0
;
for
(
int
j
=
0
;
j
<
7
;
j
++
)
{
sum_val_j
+=
_h
ij
[
i
][
j
]
*
_
series_factorRho
[
j
];
sum_val_j
+=
H
ij
[
i
][
j
]
*
series_factorRho
[
j
];
}
sum_val
+=
_
series_factorT
[
i
]
*
sum_val_j
;
sum_val
+=
series_factorT
[
i
]
*
sum_val_j
;
}
return
sum_val
;
}
double
WaterViscosityIAPWS
::
computedBarMu_dbarT
(
const
double
barT
,
double
bar_rho
)
const
double
computedBarMu_dbarT
(
const
double
barT
,
double
bar_rho
)
{
const
double
mu0_factor
=
computeBarMu0Factor
(
barT
);
const
double
sqrt_barT
=
std
::
sqrt
(
barT
);
...
...
@@ -118,7 +125,7 @@ double WaterViscosityIAPWS::computedBarMu_dbarT(const double barT,
double
barT_i
=
barT
*
barT
;
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
dmu0_factor_dbarT
-=
static_cast
<
double
>
(
i
)
*
(
_h
i
[
i
]
/
barT_i
);
dmu0_factor_dbarT
-=
static_cast
<
double
>
(
i
)
*
(
H
i
[
i
]
/
barT_i
);
barT_i
*=
barT
;
}
...
...
@@ -132,9 +139,9 @@ double WaterViscosityIAPWS::computedBarMu_dbarT(const double barT,
double
sum_val_j
=
0
;
for
(
int
j
=
0
;
j
<
7
;
j
++
)
{
sum_val_j
+=
_h
ij
[
i
][
j
]
*
_
series_factorRho
[
j
];
sum_val_j
+=
H
ij
[
i
][
j
]
*
series_factorRho
[
j
];
}
dmu1_factor_dbarT
-=
static_cast
<
double
>
(
i
)
*
_
series_factorT
[
i
-
1
]
*
dmu1_factor_dbarT
-=
static_cast
<
double
>
(
i
)
*
series_factorT
[
i
-
1
]
*
sum_val_j
/
(
barT
*
barT
);
}
...
...
@@ -146,8 +153,7 @@ double WaterViscosityIAPWS::computedBarMu_dbarT(const double barT,
dbar_mu1_dbarT
*
100.
*
sqrt_barT
/
mu0_factor
;
}
double
WaterViscosityIAPWS
::
computedBarMu_dbarRho
(
const
double
barT
,
double
bar_rho
)
const
double
computedBarMu_dbarRho
(
const
double
barT
,
double
bar_rho
)
{
double
dmu1_factor_dbar_rho
=
0.0
;
for
(
int
i
=
0
;
i
<
6
;
i
++
)
...
...
@@ -156,9 +162,9 @@ double WaterViscosityIAPWS::computedBarMu_dbarRho(const double barT,
for
(
int
j
=
1
;
j
<
7
;
j
++
)
{
sum_val_j
+=
static_cast
<
double
>
(
j
)
*
_h
ij
[
i
][
j
]
*
_
series_factorRho
[
j
-
1
];
static_cast
<
double
>
(
j
)
*
H
ij
[
i
][
j
]
*
series_factorRho
[
j
-
1
];
}
dmu1_factor_dbar_rho
+=
_
series_factorT
[
i
]
*
sum_val_j
;
dmu1_factor_dbar_rho
+=
series_factorT
[
i
]
*
sum_val_j
;
}
const
double
mu0
=
100.
*
std
::
sqrt
(
barT
)
/
computeBarMu0Factor
(
barT
);
...
...
This diff is collapsed.
Click to expand it.
MaterialLib/Fluid/Viscosity/WaterViscosityIAPWS.h
+
1
−
15
View file @
c63e5712
...
...
@@ -17,8 +17,6 @@
#ifndef OGS_WATER_VISCOSITY_IAPWS_H
#define OGS_WATER_VISCOSITY_IAPWS_H
#include
<array>
#include
<cmath>
#include
<string>
#include
"MaterialLib/Fluid/FluidProperty.h"
...
...
@@ -82,19 +80,7 @@ private:
const
double
_ref_rho
=
322.0
;
///< reference density in `kg/m^3`
const
double
_ref_mu
=
1.0e-6
;
///< reference viscosity in Pa.s
static
const
double
_hi
[
4
];
static
const
double
_hij
[
6
][
7
];
double
computeBarMu0Factor
(
const
double
barT
)
const
;
double
computeBarMu1Factor
()
const
;
double
computedBarMu_dbarT
(
const
double
barT
,
double
bar_rho
)
const
;
double
computedBarMu_dbarRho
(
const
double
barT
,
double
bar_rho
)
const
;
void
computeSeriesFactorForMu1
(
const
double
barT
,
const
double
bar_rho
)
const
;
mutable
std
::
array
<
double
,
6
>
_series_factorT
;
mutable
std
::
array
<
double
,
7
>
_series_factorRho
;
// Coefficients Hi and Hij are given in two static arrays in the cpp file.
};
}
// end namespace
...
...
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