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
Snippets
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
Dmitri Naumov
ogs
Commits
86764d53
Commit
86764d53
authored
8 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[Mat/Fluid] Add LinearConcentrationDependentDensitity model.
parent
010e577b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MaterialLib/Fluid/Density/LinearConcentrationDependentDensity.h
+80
-0
80 additions, 0 deletions
...alLib/Fluid/Density/LinearConcentrationDependentDensity.h
with
80 additions
and
0 deletions
MaterialLib/Fluid/Density/LinearConcentrationDependentDensity.h
0 → 100644
+
80
−
0
View file @
86764d53
/**
* @copyright
* Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include
<string>
#include
"BaseLib/ConfigTree.h"
#include
"MaterialLib/Fluid/FluidProperty.h"
namespace
MaterialLib
{
namespace
Fluid
{
/// Linear concentration dependent density model.
class
LinearConcentrationDependentDensity
final
:
public
FluidProperty
{
public:
/**
* @param reference_density \f$\rho_0\f$
* @param reference_concentration \f$C_0\f$
* @param fluid_density_difference_ratio \f$ \bar \alpha \f$ in reference
* Coupled groundwater flow and transport: 2. Thermohaline and 3D convection
* systems
*/
explicit
LinearConcentrationDependentDensity
(
const
double
reference_density
,
double
reference_concentration
,
const
double
fluid_density_difference_ratio
)
:
_reference_density
(
reference_density
),
_reference_concentration
(
reference_concentration
),
_fluid_density_difference_ratio
(
fluid_density_difference_ratio
)
{
}
/// Get model name.
std
::
string
getName
()
const
override
{
return
"Linear concentration dependent density"
;
}
/// Get density value.
/// \param var_vals Variable values in an array. The order of its elements
/// is given in enum class PropertyVariableType.
double
getValue
(
const
ArrayType
&
var_vals
)
const
override
{
const
double
C
=
var_vals
[
static_cast
<
int
>
(
PropertyVariableType
::
C
)];
return
_reference_density
*
(
1
+
_fluid_density_difference_ratio
*
(
C
-
_reference_concentration
));
}
/// Get the partial differential of the density with respect to
/// concentration.
/// \param var_vals Variable values in an array. The order of its elements
/// is given in enum class PropertyVariableType.
/// \param var Variable type.
double
getdValue
(
const
ArrayType
&
var_vals
,
const
PropertyVariableType
var
)
const
override
{
(
void
)
var_vals
;
if
(
var
!=
PropertyVariableType
::
C
)
return
0.0
;
return
_reference_density
*
_fluid_density_difference_ratio
;
}
private
:
const
double
_reference_density
;
const
double
_reference_concentration
;
const
double
_fluid_density_difference_ratio
;
};
}
// end namespace
}
// 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