Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dorie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
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 ()
...
@@ -144,9 +144,12 @@ void TransportSimulation<Traits>::step ()
auto
t
=
controller
->
getTime
();
auto
t
=
controller
->
getTime
();
suggest_timestep
(
controller
->
getDT
());
suggest_timestep
(
controller
->
getDT
());
// for some reason dt!=this->dt
double
courant_number
=
0.5
;
//FIXME: add keyword in inifile
const
auto
_dt
=
this
->
dt
;
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
// Check whether time intervals of grid functions are valid
if
(
Dune
::
FloatCmp
::
gt
(
water_flux_interval
.
begin
,
t
+
this
->
dt
))
if
(
Dune
::
FloatCmp
::
gt
(
water_flux_interval
.
begin
,
t
+
this
->
dt
))
DUNE_THROW
(
Dune
::
Exception
,
" "
);
DUNE_THROW
(
Dune
::
Exception
,
" "
);
...
...
dune/dorie/interface/transport_simulation.hh
View file @
71ca5234
...
@@ -298,11 +298,7 @@ public:
...
@@ -298,11 +298,7 @@ public:
void
suggest_timestep
(
TimeField
_dt
)
override
void
suggest_timestep
(
TimeField
_dt
)
override
{
{
auto
cfl_dt
=
0.3
*
Dune
::
Dorie
::
cfl_condition
(
*
gf_water_flux
);
// FIXME
dt
=
std
::
min
(
_dt
,
controller
->
getDT
());
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
;
}
}
// TODO: Define data exchange with richards
// TODO: Define data exchange with richards
...
...
dune/dorie/solver/util_cfl_condition.hh
View file @
71ca5234
...
@@ -55,7 +55,7 @@ namespace Dorie{
...
@@ -55,7 +55,7 @@ namespace Dorie{
for
(
int
i
=
1
;
i
<
geo
.
corners
();
++
i
)
for
(
int
i
=
1
;
i
<
geo
.
corners
();
++
i
)
for
(
int
j
=
0
;
j
<
i
-
1
;
++
j
)
for
(
int
j
=
0
;
j
<
i
-
1
;
++
j
)
h_T
=
std
::
max
(
h_T
,(
geo
.
corner
(
i
)
-
geo
.
corner
(
j
)).
two_norm
());
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.
// Check that h_T is not zero in debug mode, who knows.
assert
(
Dune
::
FloatCmp
::
gt
(
h_T
,
0.
));
assert
(
Dune
::
FloatCmp
::
gt
(
h_T
,
0.
));
...
@@ -69,15 +69,12 @@ namespace Dorie{
...
@@ -69,15 +69,12 @@ namespace Dorie{
gf
.
evaluate
(
cell
,
x
,
water_flux
);
gf
.
evaluate
(
cell
,
x
,
water_flux
);
max_water_flux
=
std
::
max
(
max_water_flux
,
water_flux
.
two_norm
());
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
// Calculate the cfl for this cell
if
(
Dune
::
FloatCmp
::
gt
(
max_water_flux
,
0.
))
if
(
Dune
::
FloatCmp
::
gt
(
max_water_flux
,
0.
))
suggested_dt
=
std
::
min
(
suggested_dt
,
h_T
/
max_water_flux
);
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
// Communicate the lowest cfl number to all procesors
suggested_dt
=
gv
.
comm
().
min
(
suggested_dt
);
suggested_dt
=
gv
.
comm
().
min
(
suggested_dt
);
return
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