Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDD-for-two-phase-flow-systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Seus
LDD-for-two-phase-flow-systems
Commits
4ff11763
Commit
4ff11763
authored
Jul 5, 2019
by
David Seus
Browse files
Options
Downloads
Patches
Plain Diff
use already calculated wetting pressure for nonwetting calculation
parent
9fa61d3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
LDDsimulation/LDDsimulation.py
+21
-11
21 additions, 11 deletions
LDDsimulation/LDDsimulation.py
with
21 additions
and
11 deletions
LDDsimulation/LDDsimulation.py
+
21
−
11
View file @
4ff11763
...
...
@@ -417,7 +417,7 @@ class LDDsimulation(object):
# set subdomain iteration to current iteration
subdomain
.
iteration_number
=
iteration
# solve the problem on subdomain
self
.
Lsolver_step
(
subdomain_index
=
sd_index
,
#
subsequent_error
=
self
.
Lsolver_step
(
subdomain_index
=
sd_index
,
#
debug
=
debug
,
)
# bypass subsequent error calculation for the first iteration, becauses
...
...
@@ -425,11 +425,11 @@ class LDDsimulation(object):
if
iteration
>
1
:
subsequent_iter_error
=
dict
()
for
phase
in
subdomain
.
has_phases
:
error
=
df
.
Function
(
subdomain
.
function_space
[
"
pressure
"
][
phase
])
error
.
assign
(
subdomain
.
pressure
[
phase
]
-
subdomain
.
pressure_prev_iter
[
phase
])
error_calculated
=
df
.
norm
(
error
,
'
L2
'
)
#
error = df.Function(subdomain.function_space["pressure"][phase])
#
error.assign(subdomain.pressure[phase] - subdomain.pressure_prev_iter[phase])
#
error_calculated = df.norm(error, 'L2')
subsequent_iter_error
.
update
(
{
phase
:
error_calculated
}
{
phase
:
subsequent_error
[
phase
]
}
)
if
debug
:
print
(
f
"
time =
{
time
}
: subsequent error on subdomain
{
sd_index
}
for
{
phase
}
phase in iteration
{
iteration
}
=
"
,
subsequent_iter_error
[
phase
])
...
...
@@ -462,10 +462,10 @@ class LDDsimulation(object):
write_iter_for_fixed_time
=
True
,
)
for
phase
in
subdomain
.
has_phases
:
subdomain
.
pressure_prev_iter
[
phase
].
assign
(
subdomain
.
pressure
[
phase
]
)
#
for phase in subdomain.has_phases:
#
subdomain.pressure_prev_iter[phase].assign(
#
subdomain.pressure[phase]
#
)
# end loop over subdomains
##### stopping criterion for the solver.
# only check if error criterion has been met after at least one iteration.
...
...
@@ -579,7 +579,7 @@ class LDDsimulation(object):
return
solution_over_iteration_within_timestep
def
Lsolver_step
(
self
,
subdomain_index
:
int
,
#
debug
:
bool
=
False
)
->
None
:
debug
:
bool
=
False
)
->
float
:
"""
L-scheme solver iteration step for an object of class subdomain
Lsolver_step implements L-scheme solver iteration step for an subdomain
...
...
@@ -596,7 +596,7 @@ class LDDsimulation(object):
"""
subdomain
=
self
.
subdomain
[
subdomain_index
]
iteration
=
subdomain
.
iteration_number
subsequent_error
=
dict
()
for
phase
in
subdomain
.
has_phases
:
# extract L-scheme form and rhs (without gli term) from subdomain.
governing_problem
=
subdomain
.
governing_problem
(
phase
=
phase
)
...
...
@@ -633,6 +633,16 @@ class LDDsimulation(object):
if
debug
and
subdomain
.
mesh
.
num_cells
()
<
36
:
print
(
"
\n
pressure after solver:
\n
"
,
subdomain
.
pressure
[
phase
].
vector
().
get_local
())
error
=
df
.
Function
(
subdomain
.
function_space
[
"
pressure
"
][
phase
])
error
.
assign
(
subdomain
.
pressure
[
phase
]
-
subdomain
.
pressure_prev_iter
[
phase
])
subsequent_error
.
update
({
phase
:
df
.
norm
(
error
,
'
L2
'
)})
subdomain
.
pressure_prev_iter
[
phase
].
assign
(
subdomain
.
pressure
[
phase
]
)
return
subsequent_error
def
_init_solution_files
(
self
):
"""
set up solution files for saving the solution of the LDD scheme for
...
...
...
...
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
sign in
to comment