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
Dmitry Yu. Naumov
ogs
Commits
bce5b83d
Commit
bce5b83d
authored
3 years ago
by
Norbert Grunwald
Browse files
Options
Downloads
Patches
Plain Diff
removed auxiliary functions from PTM-class
parent
cdbe2d83
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
ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.cpp
+53
-0
53 additions, 0 deletions
...ssLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.cpp
ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
+8
-39
8 additions, 39 deletions
ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
with
61 additions
and
39 deletions
ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.cpp
0 → 100644
+
53
−
0
View file @
bce5b83d
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*/
#include
"PhaseTransitionModel.h"
namespace
ProcessLib
{
namespace
TH2M
{
int
numberOfComponents
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
)
{
// Always the first (begin) medium that holds fluid phases.
auto
const
medium
=
media
.
begin
()
->
second
;
return
medium
->
phase
(
phase_name
).
numberOfComponents
();
}
int
findComponentIndex
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
,
MaterialPropertyLib
::
PropertyType
property_type
)
{
// It is always the first (begin) medium that holds fluid phases.
auto
const
medium
=
media
.
begin
()
->
second
;
auto
const
&
phase
=
medium
->
phase
(
phase_name
);
// find the component for which the property 'property_type' is defined
for
(
std
::
size_t
c
=
0
;
c
<
phase
.
numberOfComponents
();
c
++
)
{
if
(
phase
.
component
(
c
).
hasProperty
(
property_type
))
{
return
c
;
}
}
// A lot of checks can (and should) be done to make sure that the right
// components with the right properties are used. For example, the names
// of the components can be compared to check that the name of the
// evaporable component does not also correspond to the name of the
// solvate.
OGS_FATAL
(
"PhaseTransitionModel::findComponentIndex could not find the "
"specified property type in the phase."
);
}
}
// namespace TH2M
}
// namespace ProcessLib
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
+
8
−
39
View file @
bce5b83d
...
...
@@ -118,48 +118,17 @@ struct PhaseTransitionModel
ParameterLib
::
SpatialPosition
pos
,
double
const
t
,
double
const
dt
)
const
=
0
;
int
numberOfComponents
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
)
{
// Always the first (begin) medium that holds fluid phases.
auto
const
medium
=
media
.
begin
()
->
second
;
return
medium
->
phase
(
phase_name
).
numberOfComponents
();
}
int
findComponentIndex
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
,
MaterialPropertyLib
::
PropertyType
property_type
)
{
// It is always the first (begin) medium that holds fluid phases.
auto
const
medium
=
media
.
begin
()
->
second
;
auto
const
&
phase
=
medium
->
phase
(
phase_name
);
// find the component for which the property 'property_type' is defined
for
(
std
::
size_t
c
=
0
;
c
<
phase
.
numberOfComponents
();
c
++
)
{
if
(
phase
.
component
(
c
).
hasProperty
(
property_type
))
{
return
c
;
}
}
// A lot of checks can (and should) be done to make sure that the right
// components with the right properties are used. For example, the names
// of the components can be compared to check that the name of the
// evaporable component does not also correspond to the name of the
// solvate.
OGS_FATAL
(
"PhaseTransitionModel::findComponentIndex could not find the "
"specified property type in the phase."
);
}
// constitutive variables
PhaseTransitionModelVariables
cv
;
};
int
numberOfComponents
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
);
int
findComponentIndex
(
std
::
map
<
int
,
std
::
shared_ptr
<
MaterialPropertyLib
::
Medium
>>
const
&
media
,
std
::
string
phase_name
,
MaterialPropertyLib
::
PropertyType
property_type
);
}
// namespace TH2M
}
// namespace ProcessLib
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