-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into add-lc-circuit-python
- Loading branch information
Showing
28 changed files
with
158 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed the [volume-coupled flow tutorial](https://precice.org/tutorials-volume-coupled-flow.html) to correctly assign all components of the read velocity field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Updated the default suggested OpenFOAM version to v2406 [#545](https://github.com/precice/tutorials/pull/545). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Use `assign` function instead of directly accessing vectors in perpendicular-flap/solid-fenics. Fixes problem with checkpointing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
dune-fem>=2.8 | ||
pyprecice==3 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
3 changes: 2 additions & 1 deletion
3
partitioned-heat-conduction-direct/dirichlet-nutils/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
3 changes: 2 additions & 1 deletion
3
partitioned-heat-conduction-direct/neumann-nutils/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
numpy | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==6 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
from __future__ import division | ||
|
||
import numpy as np | ||
import precice | ||
|
||
|
||
def displace_flap(x, y, t, flap_tip_y): | ||
x_displ = np.zeros_like(x) | ||
y_displ = np.zeros_like(y) | ||
# get displacement independent of x, only dependent on y and t | ||
max_x_displ = 0.5 | ||
period_fac = 3 * np.pi | ||
damping_fac = 8 # damps the amplitude of the sine | ||
# defines how much the sine is shifted in y-direction | ||
shift = 0.95 | ||
# wiggles the flap periodically. | ||
# the arcsin(-shift) in the sine evaluation is necessary to start at a flap displacement of 0 at t=0 | ||
# (i.e. sin(arcsin(-shift))+shift = 0) | ||
x_displ = np.minimum(((np.sin(period_fac * t + np.arcsin(-shift)) + shift) / | ||
damping_fac), max_x_displ) * y / flap_tip_y | ||
|
||
dimensions = 2 | ||
displ = np.zeros((len(x), dimensions)) | ||
displ[:, 0] = x_displ | ||
displ[:, 1] = y_displ | ||
|
||
return displ | ||
|
||
|
||
configuration_file_name = "../precice-config.xml" | ||
participant_name = "Solid" | ||
mesh_name = "Solid-Mesh" | ||
write_data_name = 'Displacement' | ||
|
||
solver_process_index = 0 | ||
solver_process_size = 1 | ||
|
||
# define mesh | ||
H = 1 | ||
W = 0.1 | ||
|
||
interface = precice.Participant(participant_name, configuration_file_name, solver_process_index, solver_process_size) | ||
dimensions = interface.get_mesh_dimensions(mesh_name) | ||
assert (dimensions == 2) | ||
|
||
x_left = 0.0 - 0.5 * W # left boundary of the flap | ||
x_right = 0.5 * W # right boundary of the flap | ||
y_bottom = 0.0 # bottom of the flap | ||
y_top = y_bottom + H # top of the flap | ||
|
||
n = 24 # Number of vertices per side | ||
t = 0 | ||
|
||
vertices = np.zeros((2 * n, dimensions)) | ||
# define vertices of flap's left side | ||
vertices[:n, 1] = np.linspace(y_bottom, y_top, n) | ||
vertices[:n, 0] = x_left | ||
# define vertices of flap's right side | ||
vertices[n:, 1] = np.linspace(y_bottom, y_top, n) | ||
vertices[n:, 0] = x_right | ||
|
||
vertex_ids = interface.set_mesh_vertices(mesh_name, vertices) | ||
|
||
if interface.requires_initial_data(): | ||
# initially, there should be no displacement | ||
interface.write_data(np.zeros_like(vertices)) | ||
|
||
interface.initialize() | ||
# change if necessary | ||
solver_dt = np.inf | ||
# for checkpointing | ||
t_cp = 0 | ||
|
||
while interface.is_coupling_ongoing(): | ||
if interface.requires_writing_checkpoint(): | ||
t_cp = t | ||
|
||
precice_dt = interface.get_max_time_step_size() | ||
dt = min([solver_dt, precice_dt]) | ||
# wiggle the flap | ||
write_data = displace_flap(vertices[:, 0], vertices[:, 1], t, H) | ||
|
||
interface.write_data(mesh_name, write_data_name, vertex_ids, write_data) | ||
interface.advance(dt) | ||
|
||
if interface.requires_reading_checkpoint(): | ||
t = t_cp | ||
else: | ||
# update t | ||
t += dt | ||
|
||
interface.finalize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env sh | ||
set -e -u | ||
|
||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
pip install -r requirements.txt | ||
python3 fake.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils>=8.5 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
nutils==7 | ||
pyprecice==3 | ||
numpy >1, <2 | ||
pyprecice~=3.0 | ||
micro-manager-precice==0.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-9.46 KB
(61%)
volume-coupled-flow/images/tutorials-volume-coupled-flow-Ux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.