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
ebbab98c
Commit
ebbab98c
authored
3 years ago
by
garibay-j
Browse files
Options
Downloads
Patches
Plain Diff
[CL] clang-format PhreeqcIO
parent
61aa7370
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
ChemistryLib/PhreeqcIO.cpp
+24
-25
24 additions, 25 deletions
ChemistryLib/PhreeqcIO.cpp
with
24 additions
and
25 deletions
ChemistryLib/PhreeqcIO.cpp
+
24
−
25
View file @
ebbab98c
...
@@ -166,10 +166,10 @@ void setReactantMolality(Reactant& reactant,
...
@@ -166,10 +166,10 @@ void setReactantMolality(Reactant& reactant,
template
<
typename
Exchanger
>
template
<
typename
Exchanger
>
void
initializeExchangerMolality
(
Exchanger
&
exchanger
,
void
initializeExchangerMolality
(
Exchanger
&
exchanger
,
GlobalIndexType
const
&
chemical_system_id
,
GlobalIndexType
const
&
chemical_system_id
,
MaterialPropertyLib
::
Phase
const
&
solid_phase
,
MaterialPropertyLib
::
Phase
const
&
solid_phase
,
ParameterLib
::
SpatialPosition
const
&
pos
,
ParameterLib
::
SpatialPosition
const
&
pos
,
double
const
t
)
double
const
t
)
{
{
auto
const
&
solid_constituent
=
solid_phase
.
component
(
exchanger
.
name
);
auto
const
&
solid_constituent
=
solid_phase
.
component
(
exchanger
.
name
);
...
@@ -182,11 +182,11 @@ void initializeExchangerMolality(Exchanger& exchanger,
...
@@ -182,11 +182,11 @@ void initializeExchangerMolality(Exchanger& exchanger,
template
<
typename
Reactant
>
template
<
typename
Reactant
>
void
updateReactantVolumeFraction
(
Reactant
&
reactant
,
void
updateReactantVolumeFraction
(
Reactant
&
reactant
,
GlobalIndexType
const
&
chemical_system_id
,
GlobalIndexType
const
&
chemical_system_id
,
MaterialPropertyLib
::
Medium
const
&
medium
,
MaterialPropertyLib
::
Medium
const
&
medium
,
ParameterLib
::
SpatialPosition
const
&
pos
,
ParameterLib
::
SpatialPosition
const
&
pos
,
double
const
porosity
,
double
const
t
,
double
const
porosity
,
double
const
t
,
double
const
dt
)
double
const
dt
)
{
{
auto
const
&
solid_phase
=
medium
.
phase
(
"Solid"
);
auto
const
&
solid_phase
=
medium
.
phase
(
"Solid"
);
auto
const
&
liquid_phase
=
medium
.
phase
(
"AqueousLiquid"
);
auto
const
&
liquid_phase
=
medium
.
phase
(
"AqueousLiquid"
);
...
@@ -197,8 +197,7 @@ void updateReactantVolumeFraction(Reactant& reactant,
...
@@ -197,8 +197,7 @@ void updateReactantVolumeFraction(Reactant& reactant,
liquid_phase
[
MaterialPropertyLib
::
PropertyType
::
density
]
liquid_phase
[
MaterialPropertyLib
::
PropertyType
::
density
]
.
template
value
<
double
>(
vars
,
pos
,
t
,
dt
);
.
template
value
<
double
>(
vars
,
pos
,
t
,
dt
);
auto
const
&
solid_constituent
=
auto
const
&
solid_constituent
=
solid_phase
.
component
(
reactant
.
name
);
solid_phase
.
component
(
reactant
.
name
);
if
(
solid_constituent
.
hasProperty
(
if
(
solid_constituent
.
hasProperty
(
MaterialPropertyLib
::
PropertyType
::
molality
))
MaterialPropertyLib
::
PropertyType
::
molality
))
...
@@ -212,7 +211,7 @@ void updateReactantVolumeFraction(Reactant& reactant,
...
@@ -212,7 +211,7 @@ void updateReactantVolumeFraction(Reactant& reactant,
(
*
reactant
.
volume_fraction
)[
chemical_system_id
]
+=
(
*
reactant
.
volume_fraction
)[
chemical_system_id
]
+=
((
*
reactant
.
molality
)[
chemical_system_id
]
-
((
*
reactant
.
molality
)[
chemical_system_id
]
-
(
*
reactant
.
molality_prev
)[
chemical_system_id
])
*
(
*
reactant
.
molality_prev
)[
chemical_system_id
])
*
liquid_density
*
porosity
*
molar_volume
;
liquid_density
*
porosity
*
molar_volume
;
}
}
...
@@ -224,8 +223,7 @@ void setPorosityPostReaction(Reactant& reactant,
...
@@ -224,8 +223,7 @@ void setPorosityPostReaction(Reactant& reactant,
{
{
auto
const
&
solid_phase
=
medium
.
phase
(
"Solid"
);
auto
const
&
solid_phase
=
medium
.
phase
(
"Solid"
);
auto
const
&
solid_constituent
=
auto
const
&
solid_constituent
=
solid_phase
.
component
(
reactant
.
name
);
solid_phase
.
component
(
reactant
.
name
);
if
(
solid_constituent
.
hasProperty
(
if
(
solid_constituent
.
hasProperty
(
MaterialPropertyLib
::
PropertyType
::
molality
))
MaterialPropertyLib
::
PropertyType
::
molality
))
...
@@ -233,9 +231,8 @@ void setPorosityPostReaction(Reactant& reactant,
...
@@ -233,9 +231,8 @@ void setPorosityPostReaction(Reactant& reactant,
return
;
return
;
}
}
porosity
-=
porosity
-=
((
*
reactant
.
volume_fraction
)[
chemical_system_id
]
-
((
*
reactant
.
volume_fraction
)[
chemical_system_id
]
-
(
*
reactant
.
volume_fraction_prev
)[
chemical_system_id
]);
(
*
reactant
.
volume_fraction_prev
)[
chemical_system_id
]);
}
}
template
<
typename
Reactant
>
template
<
typename
Reactant
>
...
@@ -343,8 +340,8 @@ void PhreeqcIO::initializeChemicalSystemConcrete(
...
@@ -343,8 +340,8 @@ void PhreeqcIO::initializeChemicalSystemConcrete(
for
(
auto
&
exchanger
:
_chemical_system
->
exchangers
)
for
(
auto
&
exchanger
:
_chemical_system
->
exchangers
)
{
{
initializeExchangerMolality
(
exchanger
,
chemical_system_id
,
solid_phase
,
pos
,
initializeExchangerMolality
(
exchanger
,
chemical_system_id
,
solid_phase
,
t
);
pos
,
t
);
}
}
}
}
...
@@ -786,14 +783,14 @@ void PhreeqcIO::updateVolumeFractionPostReaction(
...
@@ -786,14 +783,14 @@ void PhreeqcIO::updateVolumeFractionPostReaction(
{
{
for
(
auto
&
kinetic_reactant
:
_chemical_system
->
kinetic_reactants
)
for
(
auto
&
kinetic_reactant
:
_chemical_system
->
kinetic_reactants
)
{
{
updateReactantVolumeFraction
(
kinetic_reactant
,
chemical_system_id
,
medium
,
updateReactantVolumeFraction
(
kinetic_reactant
,
chemical_system_id
,
pos
,
porosity
,
t
,
dt
);
medium
,
pos
,
porosity
,
t
,
dt
);
}
}
for
(
auto
&
equilibrium_reactant
:
_chemical_system
->
equilibrium_reactants
)
for
(
auto
&
equilibrium_reactant
:
_chemical_system
->
equilibrium_reactants
)
{
{
updateReactantVolumeFraction
(
equilibrium_reactant
,
chemical_system_id
,
medium
,
updateReactantVolumeFraction
(
equilibrium_reactant
,
chemical_system_id
,
pos
,
porosity
,
t
,
dt
);
medium
,
pos
,
porosity
,
t
,
dt
);
}
}
}
}
...
@@ -804,12 +801,14 @@ void PhreeqcIO::updatePorosityPostReaction(
...
@@ -804,12 +801,14 @@ void PhreeqcIO::updatePorosityPostReaction(
{
{
for
(
auto
&
kinetic_reactant
:
_chemical_system
->
kinetic_reactants
)
for
(
auto
&
kinetic_reactant
:
_chemical_system
->
kinetic_reactants
)
{
{
setPorosityPostReaction
(
kinetic_reactant
,
chemical_system_id
,
medium
,
porosity
);
setPorosityPostReaction
(
kinetic_reactant
,
chemical_system_id
,
medium
,
porosity
);
}
}
for
(
auto
&
equilibrium_reactant
:
_chemical_system
->
equilibrium_reactants
)
for
(
auto
&
equilibrium_reactant
:
_chemical_system
->
equilibrium_reactants
)
{
{
setPorosityPostReaction
(
equilibrium_reactant
,
chemical_system_id
,
medium
,
porosity
);
setPorosityPostReaction
(
equilibrium_reactant
,
chemical_system_id
,
medium
,
porosity
);
}
}
}
}
...
...
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