Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fxdgm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Habscheid
fxdgm
Merge requests
!9
Added Coverage
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Added Coverage
JanHab/fxdgm-testing:main
into
main
Overview
3
Commits
10
Pipelines
1
Changes
3
Merged
Jan Habscheid
requested to merge
JanHab/fxdgm-testing:main
into
main
1 month ago
Overview
3
Commits
10
Pipelines
1
Changes
3
Expand
0
0
Merge request reports
Viewing commit
cca2aa83
Prev
Next
Show latest version
3 files
+
42
−
42
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
cca2aa83
Try out coverage
· cca2aa83
Jan Habscheid
authored
1 month ago
fxdgm/Eq02.py
+
40
−
40
Options
@@ -242,47 +242,47 @@ def solve_System_2eq(phi_left:float, phi_right:float, p_right:float, z_A:float,
return
y_A_vals
,
y_C_vals
,
phi_vals
,
p_vals
,
x_vals
#
if __name__ == '__main__':
#
# Define the parameters
#
phi_left = 5.0
#
phi_right = 0.0
#
p_right = 0.0
#
y_A_R = 1/3
#
y_C_R = 1/3
#
z_A = -1.0
#
z_C = 1.0
#
K = 'incompressible'
#
Lambda2 = 8.553e-6
#
a2 = 7.5412e-4
#
number_cells = 1024
#
relax_param = .1
#
rtol = 1e-4
#
max_iter = 500
if
__name__
==
'
__main__
'
:
# pragma: no cover # dont cover main in coverage
# Define the parameters
phi_left
=
5.0
phi_right
=
0.0
p_right
=
0.0
y_A_R
=
1
/
3
y_C_R
=
1
/
3
z_A
=
-
1.0
z_C
=
1.0
K
=
'
incompressible
'
Lambda2
=
8.553e-6
a2
=
7.5412e-4
number_cells
=
1024
relax_param
=
.
1
rtol
=
1e-4
max_iter
=
500
#
# Solve the system
#
y_A, y_C, phi, p, x = solve_System_2eq(phi_left, phi_right, p_right, z_A, z_C, y_A_R, y_C_R, K, Lambda2, a2, number_cells, relax_param=relax_param, x0=0, x1=1, refinement_style='uniform', return_type='Vector', max_iter=max_iter, rtol=rtol)
# Solve the system
y_A
,
y_C
,
phi
,
p
,
x
=
solve_System_2eq
(
phi_left
,
phi_right
,
p_right
,
z_A
,
z_C
,
y_A_R
,
y_C_R
,
K
,
Lambda2
,
a2
,
number_cells
,
relax_param
=
relax_param
,
x0
=
0
,
x1
=
1
,
refinement_style
=
'
uniform
'
,
return_type
=
'
Vector
'
,
max_iter
=
max_iter
,
rtol
=
rtol
)
#
# Plot the solution
#
plt.plot(x, phi)
#
plt.xlim(0,0.05)
#
plt.grid()
#
plt.xlabel('x [-]')
#
plt.ylabel('$\\varphi$ [-]')
#
plt.show()
# Plot the solution
plt
.
plot
(
x
,
phi
)
plt
.
xlim
(
0
,
0.05
)
plt
.
grid
()
plt
.
xlabel
(
'
x [-]
'
)
plt
.
ylabel
(
'
$
\\
varphi$ [-]
'
)
plt
.
show
()
#
plt.plot(x, y_A, '--', color='tab:blue', label='$y_A$')
#
plt.plot(x, y_C, '-', color='tab:blue', label='$y_C$')
#
plt.plot(x, 1 - y_A - y_C, ':', color='tab:blue', label='$y_S$')
#
plt.xlim(0,0.05)
#
plt.legend()
#
plt.grid()
#
plt.xlabel('x [-]')
#
plt.ylabel('$y_\\alpha$ [-]')
#
plt.show()
plt
.
plot
(
x
,
y_A
,
'
--
'
,
color
=
'
tab:blue
'
,
label
=
'
$y_A$
'
)
plt
.
plot
(
x
,
y_C
,
'
-
'
,
color
=
'
tab:blue
'
,
label
=
'
$y_C$
'
)
plt
.
plot
(
x
,
1
-
y_A
-
y_C
,
'
:
'
,
color
=
'
tab:blue
'
,
label
=
'
$y_S$
'
)
plt
.
xlim
(
0
,
0.05
)
plt
.
legend
()
plt
.
grid
()
plt
.
xlabel
(
'
x [-]
'
)
plt
.
ylabel
(
'
$y_
\\
alpha$ [-]
'
)
plt
.
show
()
#
plt.plot(x, p)
#
plt.xlim(0,0.05)
#
plt.grid()
#
plt.xlabel('x [-]')
#
plt.ylabel('$p$ [-]')
#
plt.show()
plt
.
plot
(
x
,
p
)
plt
.
xlim
(
0
,
0.05
)
plt
.
grid
()
plt
.
xlabel
(
'
x [-]
'
)
plt
.
ylabel
(
'
$p$ [-]
'
)
plt
.
show
()
Loading