Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F76446965
reactive_transport.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
Thu, Aug 8, 00:45
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Aug 10, 00:45 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
19660363
Attached To
rSPECMICP SpecMiCP / ReactMiCP
reactive_transport.cpp
View Options
#include "catch.hpp"
#include "utils.hpp"
#include "reactmicp/systems/saturated_diffusion/boundary_conditions.hpp"
#include "reactmicp/systems/saturated_diffusion/reactive_transport_solver.hpp"
using
namespace
specmicp
;
using
namespace
specmicp
::
reactmicp
;
using
namespace
specmicp
::
reactmicp
::
systems
;
using
namespace
specmicp
::
reactmicp
::
systems
::
siasaturated
;
TEST_CASE
(
"reactive transport solver"
,
"[reactive transport, speciation, dfpm, solver]"
)
{
int
nb_nodes
=
5
;
std
::
shared_ptr
<
database
::
DataContainer
>
database
=
get_test_carbo_database
();
std
::
shared_ptr
<
mesh
::
Mesh1D
>
themesh
=
std
::
make_shared
<
mesh
::
Mesh1D
>
(
nb_nodes
-
1
,
1e-3
,
0.001
);
auto
parameters
=
std
::
make_shared
<
SaturatedDiffusionTransportParameters
>
(
1e-8
,
0.2
);
SIABoundaryConditions
bcs
(
nb_nodes
);
bcs
.
list_initial_states
.
push_back
(
sample_carbo_composition
(
database
));
bcs
.
list_initial_states
.
push_back
(
blank_composition
(
database
));
bcs
.
bs_types
[
0
]
=
BoundaryConditionType
::
FixedComposition
;
bcs
.
initial_states
[
0
]
=
1
;
SECTION
(
"Initialization"
)
{
SIASaturatedReactiveTransportSolver
solver
(
themesh
,
database
,
parameters
);
solver
.
apply_boundary_conditions
(
bcs
);
SIASaturatedVariables
&
variables
=
solver
.
get_variables
();
REQUIRE
(
std
::
abs
(
variables
.
mineral_amount
(
1
,
1
)
-
bcs
.
list_initial_states
[
0
].
moles_mineral
(
1
))
<
1e-10
);
REQUIRE
(
std
::
abs
(
variables
.
component_concentration
(
1
,
1
)
-
bcs
.
list_initial_states
[
0
].
molality_component
(
1
))
<
1e-10
);
REQUIRE
(
std
::
abs
(
variables
.
mineral_amount
(
0
,
1
)
-
bcs
.
list_initial_states
[
1
].
moles_mineral
(
1
))
<
1e-10
);
REQUIRE
(
std
::
abs
(
variables
.
component_concentration
(
0
,
1
)
-
bcs
.
list_initial_states
[
1
].
molality_component
(
1
))
<
1e-10
);
}
}
Event Timeline
Log In to Comment