Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78048952
variables.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Aug 18, 02:21
Size
2 KB
Mime Type
text/x-c
Expires
Tue, Aug 20, 02:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19972738
Attached To
rSPECMICP SpecMiCP / ReactMiCP
variables.cpp
View Options
#include "catch.hpp"
#include "speciation_system.hpp"
#include "specmicp/adimensional/adimensional_system_solution.hpp"
#include "specmicp/adimensional/adimensional_system_solution_extractor.hpp"
#include "dfpm/mesh.hpp"
#include "reactmicp/systems/saturated_react/variables.hpp"
#include "reactmicp/systems/saturated_react/init_variables.hpp"
TEST_CASE
(
"Saturated Variables test"
,
"[SaturatedReact, variables, initialisation]"
)
{
SECTION
(
"Initialisation"
)
{
specmicp
::
units
::
UnitsSet
the_units
;
the_units
.
mass
=
specmicp
::
units
::
MassUnit
::
kilogram
;
the_units
.
length
=
specmicp
::
units
::
LengthUnit
::
centimeter
;
specmicp
::
mesh
::
Mesh1DPtr
the_mesh
=
specmicp
::
mesh
::
uniform_mesh1d
(
5
,
0.1
,
5.0
);
specmicp
::
RawDatabasePtr
the_database
=
leaching_database
();
std
::
vector
<
specmicp
::
AdimensionalSystemSolution
>
list_initial_composition
;
list_initial_composition
.
push_back
(
initial_leaching_pb
(
the_database
,
0.005
,
the_units
));
list_initial_composition
.
push_back
(
initial_blank_leaching_pb
(
the_database
,
0.005
,
the_units
));
std
::
vector
<
specmicp
::
index_t
>
list_fixed_nodes
=
{
0
,
};
std
::
vector
<
int
>
index_initial_state
=
{
1
,
0
,
0
,
0
,
0
};
specmicp
::
reactmicp
::
systems
::
satdiff
::
SaturatedVariablesPtr
variables
=
specmicp
::
reactmicp
::
systems
::
satdiff
::
init_variables
(
the_mesh
,
the_database
,
the_units
,
list_fixed_nodes
,
list_initial_composition
,
index_initial_state
);
REQUIRE
(
variables
->
dof_porosity
(
0
)
==
0
);
REQUIRE
(
variables
->
equilibrium_solution
(
1
).
secondary_molalities
(
3
)
==
list_initial_composition
[
0
].
secondary_molalities
(
3
)
);
REQUIRE
(
variables
->
equilibrium_solution
(
0
).
secondary_molalities
(
3
)
==
list_initial_composition
[
1
].
secondary_molalities
(
3
)
);
REQUIRE
(
variables
->
aqueous_concentration
(
4
,
2
,
variables
->
velocity
())
==
0
);
specmicp
::
AdimensionalSystemSolutionExtractor
extractor
(
list_initial_composition
[
0
],
the_database
,
the_units
);
REQUIRE
(
variables
->
aqueous_concentration
(
2
,
1
,
variables
->
displacement
())
==
extractor
.
density_water
()
*
extractor
.
total_aqueous_concentration
(
1
)
);
}
}
Event Timeline
Log In to Comment