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
4a8db85e
Commit
4a8db85e
authored
8 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[Test] Added two tests of FluidPropertiesWithDensityDependentModels
parent
08f3b0d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/MaterialLib/TestFluidProperties.cpp
+84
-0
84 additions, 0 deletions
Tests/MaterialLib/TestFluidProperties.cpp
with
84 additions
and
0 deletions
Tests/MaterialLib/TestFluidProperties.cpp
+
84
−
0
View file @
4a8db85e
...
...
@@ -78,3 +78,87 @@ TEST(MaterialFluidProperties, checkPrimaryVariableDependentFluidProperties)
Fluid
::
PropertyVariableType
::
T
),
1.e-10
);
}
TEST
(
MaterialFluidProperties
,
checkFluidPropertiesWithDensityDependentModels_T
)
{
const
char
xml
[]
=
"<fluid>"
" <density>"
" <type>TemperatureDependent</type>"
" <temperature0> 293.0 </temperature0> "
" <beta> 2.5003219164466073e-05 </beta> "
" <rho0> 998.</rho0>"
" </density>"
" <viscosity>"
" <type>WaterViscosityIAPWS</type>"
" </viscosity>"
"</fluid>"
;
auto
const
fluid_model
=
createTestFluidProperties
(
xml
);
ArrayType
vars
;
vars
[
0
]
=
373.15
;
const
double
rho
=
fluid_model
->
getValue
(
FluidPropertyType
::
Density
,
vars
);
ASSERT_NEAR
(
1000.0
,
rho
,
1.e-10
);
const
double
mu
=
fluid_model
->
getValue
(
FluidPropertyType
::
Vicosity
,
vars
);
ASSERT_NEAR
(
0.307883622e-3
,
mu
,
1.e-10
);
const
double
drho_dT
=
fluid_model
->
getdValue
(
FluidPropertyType
::
Density
,
vars
,
MaterialLib
::
Fluid
::
PropertyVariableType
::
T
);
const
double
dmu_dT
=
fluid_model
->
getdValue
(
FluidPropertyType
::
Vicosity
,
vars
,
MaterialLib
::
Fluid
::
PropertyVariableType
::
T
);
const
double
perturbation
=
1.e-6
;
vars
[
0
]
+=
perturbation
;
const
double
rho1
=
fluid_model
->
getValue
(
FluidPropertyType
::
Density
,
vars
);
const
double
mu1
=
fluid_model
->
getValue
(
FluidPropertyType
::
Vicosity
,
vars
);
ASSERT_NEAR
((
rho1
-
rho
)
/
perturbation
,
drho_dT
,
1.e-7
);
ASSERT_NEAR
((
mu1
-
mu
)
/
perturbation
,
dmu_dT
,
1.e-10
);
}
TEST
(
MaterialFluidProperties
,
checkFluidPropertiesWithDensityDependentModels_dp
)
{
const
char
xml
[]
=
"<fluid>"
" <density>"
" <type>LiquidDensity</type>"
" <temperature0> 273.15 </temperature0> "
" <p0> 1.e+5 </p0> "
" <bulk_modulus> 2.15e+9 </bulk_modulus> "
" <beta> 2.0e-4 </beta> "
" <rho0>999.8</rho0>"
" </density>"
" <viscosity>"
" <type>WaterViscosityIAPWS</type>"
" </viscosity>"
"</fluid>"
;
auto
const
fluid_model
=
createTestFluidProperties
(
xml
);
ArrayType
vars
=
{{
273.15
+
60.0
,
1.e+6
}};
const
double
rho
=
fluid_model
->
getValue
(
FluidPropertyType
::
Density
,
vars
);
const
double
mu
=
fluid_model
->
getValue
(
FluidPropertyType
::
Vicosity
,
vars
);
const
double
drho_dp
=
fluid_model
->
getdValue
(
FluidPropertyType
::
Density
,
vars
,
MaterialLib
::
Fluid
::
PropertyVariableType
::
p
);
const
double
dmu_dp
=
fluid_model
->
getdValue
(
FluidPropertyType
::
Vicosity
,
vars
,
MaterialLib
::
Fluid
::
PropertyVariableType
::
p
);
const
double
perturbation
=
1.e-6
;
vars
[
1
]
+=
perturbation
;
const
double
rho1
=
fluid_model
->
getValue
(
FluidPropertyType
::
Density
,
vars
);
const
double
mu1
=
fluid_model
->
getValue
(
FluidPropertyType
::
Vicosity
,
vars
);
// Only check d()/drho * drho/dp (FluidPropertiesWithDensityDependentModels)
// The other functionalities of fluid property models are checked in other
// tests in TestFluid*.cpp files.
ASSERT_NEAR
((
rho1
-
rho
)
/
perturbation
,
drho_dp
,
1.e-7
);
ASSERT_NEAR
((
mu1
-
mu
)
/
perturbation
,
dmu_dp
,
1.e-10
);
}
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