Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dorie
dorie
Commits
71ca5234
Commit
71ca5234
authored
Oct 04, 2018
by
Santiago Ospina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable cfl only of explicit schemes
Signed-off-by:
Santiago Ospina
<
santiago.ospina@iup.uni-heidelberg.de
>
parent
63d78946
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
dune/dorie/interface/transport_simulation.cc
dune/dorie/interface/transport_simulation.cc
+5
-2
dune/dorie/interface/transport_simulation.hh
dune/dorie/interface/transport_simulation.hh
+1
-5
dune/dorie/solver/util_cfl_condition.hh
dune/dorie/solver/util_cfl_condition.hh
+2
-5
No files found.
dune/dorie/interface/transport_simulation.cc
View file @
71ca5234
...
...
@@ -144,9 +144,12 @@ void TransportSimulation<Traits>::step ()
auto
t
=
controller
->
getTime
();
suggest_timestep
(
controller
->
getDT
());
// for some reason dt!=this->dt
const
auto
_dt
=
this
->
dt
;
double
courant_number
=
0.5
;
//FIXME: add keyword in inifile
if
(
not
ts_param
->
implicit
())
this
->
suggest_timestep
(
courant_number
*
Dune
::
Dorie
::
cfl_condition
(
*
gf_water_flux
));
// for some reason dt!=this->dt, any idea why?
// Check whether time intervals of grid functions are valid
if
(
Dune
::
FloatCmp
::
gt
(
water_flux_interval
.
begin
,
t
+
this
->
dt
))
DUNE_THROW
(
Dune
::
Exception
,
" "
);
...
...
dune/dorie/interface/transport_simulation.hh
View file @
71ca5234
...
...
@@ -298,11 +298,7 @@ public:
void
suggest_timestep
(
TimeField
_dt
)
override
{
auto
cfl_dt
=
0.3
*
Dune
::
Dorie
::
cfl_condition
(
*
gf_water_flux
);
// FIXME
std
::
cout
<<
"cfl_dt: "
<<
cfl_dt
<<
std
::
endl
;
this
->
dt
=
std
::
min
(
_dt
,
controller
->
getDT
());
this
->
dt
=
std
::
min
(
dt
,
cfl_dt
);
std
::
cout
<<
"dt: "
<<
cfl_dt
<<
std
::
endl
;
dt
=
std
::
min
(
_dt
,
controller
->
getDT
());
}
// TODO: Define data exchange with richards
...
...
dune/dorie/solver/util_cfl_condition.hh
View file @
71ca5234
...
...
@@ -55,7 +55,7 @@ namespace Dorie{
for
(
int
i
=
1
;
i
<
geo
.
corners
();
++
i
)
for
(
int
j
=
0
;
j
<
i
-
1
;
++
j
)
h_T
=
std
::
max
(
h_T
,(
geo
.
corner
(
i
)
-
geo
.
corner
(
j
)).
two_norm
());
std
::
cout
<<
"h_T: "
<<
h_T
<<
std
::
endl
;
// Check that h_T is not zero in debug mode, who knows.
assert
(
Dune
::
FloatCmp
::
gt
(
h_T
,
0.
));
...
...
@@ -69,15 +69,12 @@ namespace Dorie{
gf
.
evaluate
(
cell
,
x
,
water_flux
);
max_water_flux
=
std
::
max
(
max_water_flux
,
water_flux
.
two_norm
());
}
std
::
cout
<<
"max_water_flux: "
<<
max_water_flux
<<
std
::
endl
;
// Calculate the cfl for this cell
if
(
Dune
::
FloatCmp
::
gt
(
max_water_flux
,
0.
))
suggested_dt
=
std
::
min
(
suggested_dt
,
h_T
/
max_water_flux
);
std
::
cout
<<
"suggested_dt: "
<<
suggested_dt
<<
std
::
endl
;
}
std
::
cout
<<
"FINAL suggested_dt: "
<<
suggested_dt
<<
std
::
endl
;
// Communicate the lowest cfl number to all procesors
suggested_dt
=
gv
.
comm
().
min
(
suggested_dt
);
return
suggested_dt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment