Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
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
Releases
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
MostafaMollaali
dynamic
Commits
6561289e
Commit
6561289e
authored
8 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[FL] Added a function to create FluidProperties
parent
9190d70d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.cpp
+100
-0
100 additions, 0 deletions
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.cpp
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h
+35
-0
35 additions, 0 deletions
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h
with
135 additions
and
0 deletions
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.cpp
0 → 100644
+
100
−
0
View file @
6561289e
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file CreateFluidProperties.cpp
*
* Created on December 13, 2016, 3:32 PM
*/
#include
"CreateFluidProperties.h"
#include
<string>
#include
"BaseLib/ConfigTree.h"
#include
"FluidProperties.h"
#include
"PrimaryVariableDependentFluidProperties.h"
#include
"FluidPropertiesWithDensityDependentModels.h"
#include
"MaterialLib/Fluid/FluidPropertyHeaders.h"
#include
"MaterialLib/Fluid/SpecificHeatCapacity/CreateSpecificFluidHeatCapacityModel.h"
#include
"MaterialLib/Fluid/ThermalConductivity/CreateFluidThermalConductivityModel.h"
namespace
MaterialLib
{
namespace
Fluid
{
std
::
unique_ptr
<
FluidProperties
>
createFluidProperties
(
BaseLib
::
ConfigTree
const
&
config
)
{
//! \ogs_file_param{material__fluid__density}
auto
const
&
rho_conf
=
config
.
getConfigSubtree
(
"density"
);
auto
liquid_density
=
MaterialLib
::
Fluid
::
createFluidDensityModel
(
rho_conf
);
//! \ogs_file_param{material__fluid__viscosity}
auto
const
&
mu_conf
=
config
.
getConfigSubtree
(
"viscosity"
);
auto
viscosity
=
MaterialLib
::
Fluid
::
createViscosityModel
(
mu_conf
);
const
bool
is_mu_density_dependent
=
(
viscosity
->
getName
().
find
(
"density dependent"
)
!=
std
::
string
::
npos
)
?
true
:
false
;
bool
is_cp_density_dependent
=
false
;
std
::
unique_ptr
<
MaterialLib
::
Fluid
::
FluidProperty
>
specific_heat_capacity
=
nullptr
;
auto
heat_capacity__opt_conf
=
//! \ogs_file_param{material__fluid__specific_heat_capacity}
config
.
getConfigSubtreeOptional
(
"specific_heat_capacity"
);
if
(
heat_capacity__opt_conf
)
{
const
auto
&
heat_capacity_conf
=
*
heat_capacity__opt_conf
;
specific_heat_capacity
=
createSpecificFluidHeatCapacityModel
(
heat_capacity_conf
);
is_cp_density_dependent
=
(
specific_heat_capacity
->
getName
().
find
(
"density dependent"
)
!=
std
::
string
::
npos
)
?
true
:
false
;
}
bool
is_KT_density_dependent
=
false
;
std
::
unique_ptr
<
MaterialLib
::
Fluid
::
FluidProperty
>
thermal_conductivity
=
nullptr
;
auto
const
&
thermal_conductivity_opt_conf
=
//! \ogs_file_param{material__fluid__thermal_conductivity}
config
.
getConfigSubtreeOptional
(
"thermal_conductivity"
);
if
(
thermal_conductivity_opt_conf
)
{
auto
&
thermal_conductivity_conf
=
*
thermal_conductivity_opt_conf
;
thermal_conductivity
=
MaterialLib
::
Fluid
::
createFluidThermalConductivityModel
(
thermal_conductivity_conf
);
is_KT_density_dependent
=
(
specific_heat_capacity
->
getName
().
find
(
"density dependent"
)
!=
std
::
string
::
npos
)
?
true
:
false
;
}
if
(
is_mu_density_dependent
||
is_cp_density_dependent
||
is_KT_density_dependent
)
return
std
::
unique_ptr
<
MaterialLib
::
Fluid
::
FluidProperties
>
(
new
MaterialLib
::
Fluid
::
FluidPropertiesWithDensityDependentModels
(
std
::
move
(
liquid_density
),
std
::
move
(
viscosity
),
std
::
move
(
specific_heat_capacity
),
std
::
move
(
thermal_conductivity
),
is_mu_density_dependent
,
is_cp_density_dependent
,
is_KT_density_dependent
));
else
return
std
::
unique_ptr
<
MaterialLib
::
Fluid
::
FluidProperties
>
(
new
MaterialLib
::
Fluid
::
PrimaryVariableDependentFluidProperties
(
std
::
move
(
liquid_density
),
std
::
move
(
viscosity
),
std
::
move
(
specific_heat_capacity
),
std
::
move
(
thermal_conductivity
)));
}
}
// end namespace
}
// end namespace
This diff is collapsed.
Click to expand it.
MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h
0 → 100644
+
35
−
0
View file @
6561289e
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* \file CreateFluidProperties.h
*
* Created on December 13, 2016, 3:32 PM
*/
#ifndef OGS_CREATE_FLUID_PROPERTIES_H
#define OGS_CREATE_FLUID_PROPERTIES_H
#include
<memory>
namespace
BaseLib
{
class
ConfigTree
;
}
namespace
MaterialLib
{
namespace
Fluid
{
class
FluidProperties
;
/// Create an instance of class FluidProperties
/// \param config ConfigTree object has tags of `<fluid>`
std
::
unique_ptr
<
FluidProperties
>
createFluidProperties
(
BaseLib
::
ConfigTree
const
&
config
);
}
// end namespace
}
// end namespace
#endif
/* OGS_CREATE_FLUID_PROPERTIES_H */
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