Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Commits
aac291a1
Commit
aac291a1
authored
10 years ago
by
Franck Pérignon
Browse files
Options
Downloads
Patches
Plain Diff
ksdj
parent
97de7206
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
HySoP/hysop/operator/discrete/drag_and_lift.py
+48
-4
48 additions, 4 deletions
HySoP/hysop/operator/discrete/drag_and_lift.py
with
48 additions
and
4 deletions
HySoP/hysop/operator/discrete/drag_and_lift.py
+
48
−
4
View file @
aac291a1
...
...
@@ -321,9 +321,11 @@ class NocaForces(Forces):
s_x0
=
self
.
_voc
.
surf
[
2
*
d
]
s_xn
=
self
.
_voc
.
surf
[
2
*
d
+
1
]
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_x0
,
self
.
_buffer
,
-
1
)
self
.
_buffer
,
-
1
,
2
*
d
)
self
.
force
+=
self
.
_buffer
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_xn
,
self
.
_buffer
,
1
)
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_xn
,
self
.
_buffer
,
1
,
2
*
d
+
1
)
self
.
force
+=
self
.
_buffer
self
.
force
*=
self
.
_normalization
...
...
@@ -352,9 +354,32 @@ class NocaForces(Forces):
s_x0
=
self
.
_voc
.
surf
[
2
*
d
]
s_xn
=
self
.
_voc
.
surf
[
2
*
d
+
1
]
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_x0
,
self
.
_buffer
,
-
1
)
-
1
,
2
*
d
)
self
.
force
+=
self
.
_buffer
*
dsurf
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_xn
,
self
.
_buffer
,
1
)
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_xn
,
self
.
_buffer
,
1
,
2
*
d
+
1
)
self
.
force
+=
self
.
_buffer
*
dsurf
self
.
force
*=
self
.
_normalization
def
_noca_III
(
self
,
dt
):
"""
Computes local values of the forces using formula 2.10
(
"
Flux Equation
"
) from Noca99
@param dt : current time step
@return the local (i.e. current mpi process) forces
"""
# -- Integrals on surfaces --
# Only on surf. normal to dir in self._surfdir.
for
d
in
self
.
_surfdir
:
s_x0
=
self
.
_voc
.
surf
[
2
*
d
]
s_xn
=
self
.
_voc
.
surf
[
2
*
d
+
1
]
self
.
_buffer
[...]
=
self
.
_integrate_gamm_flux
(
s_x0
,
self
.
_buffer
,
-
1
,
2
*
d
)
self
.
force
+=
self
.
_buffer
*
dsurf
self
.
_buffer
[...]
=
self
.
_integrate_gamm_imp
(
s_xn
,
self
.
_buffer
,
1
,
2
*
d
+
1
)
self
.
force
+=
self
.
_buffer
*
dsurf
self
.
force
*=
self
.
_normalization
...
...
@@ -439,3 +464,22 @@ class NocaForces(Forces):
buff
[...]
=
coords
[
j
]
*
buff
[...]
res
[
i_n
]
+=
npw
.
real_sum
(
coords
[
j
]
*
buff
)
res
[
j
]
-=
x0
*
npw
.
real_sum
(
buff
)
def
_integrate_gamma_flux
(
self
,
surf
,
res
,
normal
,
nsurf
):
# i_n : normal dir
# i_t : other dirs
i_n
=
surf
.
n_dir
i_t
=
surf
.
t_dir
coords
=
surf
.
mesh
[
self
.
_topology
].
coords4int
x0
=
coords
[
i_n
].
flat
[
0
]
res
+=
self
.
_integrate_gamma_imp
(
surf
,
res
,
normal
,
nsurf
)
for
j
in
i_t
:
buff
=
self
.
_rwork
[
nsurf
]
# buff is supposed to handle velocity at the previous time step
buff
[...]
-=
self
.
velocity
.
data
[
j
][
sl
]
# compute diff(velocity,t ) in buff
buff
[...]
*=
-
1.
/
dt
buff
[...]
=
coords
[
j
]
*
buff
[...]
res
[
i_n
]
+=
npw
.
real_sum
(
coords
[
j
]
*
buff
)
res
[
j
]
-=
x0
*
npw
.
real_sum
(
buff
)
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
register
or
sign in
to comment