Skip to content

Port two-scale-heat-conduction case from DuMuX-Adapter #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1f557c2
Update README.md
BenjaminRodenberg Dec 16, 2022
8b347c2
Merge pull request #316 from precice/fix-link-and-doc
MakisH Dec 17, 2022
c6726b3
Update notes on solids4Foam
MakisH Dec 21, 2022
0e317f9
Update notes on solids4foam (remove link to Eigen issue)
MakisH Dec 21, 2022
71e6b5c
Replaced all <use-mesh> tags by <receive-mesh> and <provide-mesh> tag…
Timo-Schrader Jan 9, 2023
d1a041a
Adding FEniCSx solver to partitioned-heat-equation tutorial (#317)
PhilipHildebrand Jan 23, 2023
dbabd40
PEP8 formatting
IshaanDesai Jan 23, 2023
4362b96
Remove mapping timings (#321)
davidscn Jan 24, 2023
0a9bd0e
Fix broken turbines image link
uekerman Feb 6, 2023
907c824
Refactor to work better with scaling.
BenjaminRodenberg Feb 13, 2023
5839e2c
Add picture to heat-exchanger-simplified (#327)
MakisH Feb 28, 2023
7e568e4
Update elastic-tube-1d/solid-cpp
fsimonis Mar 24, 2023
8955a34
Update elastic-tube-1d/fluid-cpp
fsimonis Mar 24, 2023
454e6ed
Update to v3 preCICE API. (#332)
BenjaminRodenberg Apr 3, 2023
2159b3c
Port rbf mapping configs to precice v3 (#331)
davidscn Apr 4, 2023
9309af5
Fix typo in config file
davidscn Apr 5, 2023
362606a
Build cpp solvers as part of run (#330)
fsimonis Apr 20, 2023
8f9125a
Remove link to run.precice.org from Quickstart
MakisH Apr 26, 2023
b845c9e
Markdown-lint: Disable MD034 (#339)
MakisH May 19, 2023
39361f0
Update fvSolution to fit OpenFOAM 9 and newer (#337)
theBelpo May 20, 2023
49c0a7e
Tutorials on fluid-fluid coupling with the preCICE OpenFOAM adapter (…
thesamriel Jun 13, 2023
7a5c4f3
Rename m2n attributes to connector and acceptor (#341)
davidscn Jun 21, 2023
6954aa3
Fix typos in perpendicular flap
MakisH Jul 11, 2023
df47e71
Quickstart: Update the recommended OpenFOAM version to v2306
MakisH Jul 19, 2023
73a5edc
Remove tag solver-interface (#348)
MakisH Jul 24, 2023
657a2c8
Add Systemtests (#347)
valentin-seitz Aug 2, 2023
f9bcb48
Fixed Docker compose root user problem #354 (#355)
valentin-seitz Aug 3, 2023
b77f0b4
Add FEniCS adapter (#357)
valentin-seitz Aug 4, 2023
1af7393
Added Timestamps to not override the folder (#358)
valentin-seitz Aug 7, 2023
6a487d8
removed the user mapping. (#362)
valentin-seitz Aug 9, 2023
b198e30
Add ability to compare fields (#363)
valentin-seitz Aug 14, 2023
078f432
Add precice-events to the cleaning scripts (#365)
MakisH Aug 14, 2023
bddfd5e
Move dimensions to each mesh (#367)
MakisH Aug 15, 2023
1a1f2d5
Channel transport with OpenFOAM (#315)
tirgendetwas Aug 15, 2023
9b4fba4
Reduce verbosity in openfoam-remove-empty-dirs.sh (#368)
MakisH Aug 16, 2023
ad39b08
Volume-coupled flow tutorial (#350)
tirgendetwas Aug 16, 2023
dd75e93
Update configs for FF tutorials
MakisH Aug 16, 2023
595a2c7
Remove wrong keywords from tutorial readme
MakisH Aug 16, 2023
0fbb73f
Port nutils cases to preCICE v3 (#370)
MakisH Sep 3, 2023
f67ae5a
autopep8 formatting of Nutils scripts
IshaanDesai Sep 5, 2023
847a6f0
Add new tutorial: two-scale-heat-conduction (#343)
IshaanDesai Sep 5, 2023
0cd624e
Have one Dockerfile instead of multiples (#364)
valentin-seitz Sep 5, 2023
3bfa5a8
port two-scale-heat-conduction case with DuMuX-DuMuX
Sep 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar.gz filter=lfs diff=lfs merge=lfs -text
88 changes: 88 additions & 0 deletions .github/workflows/run_testsuite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Run Testsuite (manual) # Unfortunately, we cannot modify the name: https://github.community/t/github-actions-dynamic-name-of-the-workflow-with-workflow-dispatch/150327
on:
workflow_dispatch:
inputs:
testsuites:
description: 'Virtual Environment'
default: 'openfoam-adapter-release'
required: true
type: choice
options:
- openfoam-adapter-release
- openfoam-adapter-pr
- fenics-test
build_args:
description: 'Build arguments'
default: 'OPENFOAM_EXECUTABLE:openfoam2212,PRECICE_TAG:latest,OPENFOAM_ADAPTER_REF:master'
required: true
type: choice
options:
- 'OPENFOAM_EXECUTABLE:openfoam2212,PRECICE_TAG:latest,OPENFOAM_ADAPTER_REF:master'
- 'OPENFOAM_EXECUTABLE:openfoam2112,PRECICE_TAG:latest,OPENFOAM_ADAPTER_REF:master'
- 'OPENFOAM_EXECUTABLE:openfoam2212,PRECICE_TAG:develop,OPENFOAM_ADAPTER_REF:develop'
tutorial_branch:
description: 'Branch to take the tutorials from'
default: 'master'
required: true
type: choice
options:
- 'develop'
- 'master'
systests_branch:
description: 'Branch to take the systest from'
default: 'add-systemtests'
required: true
type: choice
options:
- 'develop'
- 'master'
- 'add-systemtests'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Report log
run: |
echo "Initiated by: ${{ github.actor }}"
echo "Running systemtests --build_args=${{github.event.inputs.build_args}} --suites=${{github.event.inputs.testsuites}}"
echo "Tutorials branch: ${{ github.event.inputs.tutorial_branch }}"
echo "Systemtests branch: ${{ github.event.inputs.systests_branch }}"
- name: Check out Tutorials
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tutorial_branch }}
path: 'tutorials'
- name: Check out Tutorials for systest
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.systests_branch }}
path: 'systest'
- name: Log directory
run: |
ls -al
pwd
- name: Copy folders and files from systest into tutorials
run: |
cp -R systest/tools/* tutorials/tools
cd systest
find . -type f -name "metadata.yaml" -exec cp --parents {} ../tutorials \;
cd ..
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: install python depencies
run: |
python -m pip install -r tutorials/tools/tests/requirements.txt
- name: Run tests
run: |
cd tutorials/tools/tests
python systemtests.py --build_args=${{github.event.inputs.build_args}} --suites=${{github.event.inputs.testsuites}}
cd ../../
- name: Archive run files
uses: actions/upload-artifact@v2
with:
name: runs
path: |
tutorials/runs/*
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"MD013": false,
"MD033": false
"MD033": false,
"MD034": false
}
2 changes: 1 addition & 1 deletion aste-turbine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you are completely new to ASTE have a look at our [ASTE documentation](https:

Our example consists of a wind turbine blade geometry, which was triangulated using different refinement levels. The mesh files are stored in [this GitLab repository](https://gitlab.lrz.de/precice/precice2-ref-paper-setup) and correspond to the mesh files used for the mapping tests of our [version 2 reference paper](https://doi.org/10.12688/openreseurope.14445.1). The mesh files are automatically downloaded when the `run.sh` script is executed. In this example setup, we map the mesh `0.01.vtk` (left side of the figure) to the mesh `0.006.vtk` (right side of the figure).

![Turbine setup](images/tutorials-aste-setup.png)
![Turbine setup](images/tutorials-aste-turbine-setup.png)

## Running the tutorial

Expand Down
68 changes: 34 additions & 34 deletions aste-turbine/precice-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@
format="---[precice] %ColorizedSeverity% %Message%"
enabled="true" />
</log>

<solver-interface dimensions="3">

<data:scalar name="Data" />
<data:scalar name="Data" />

<mesh name="A-Mesh">
<use-data name="Data" />
</mesh>
<mesh name="A-Mesh" dimensions="3">
<use-data name="Data" />
</mesh>

<mesh name="B-Mesh">
<use-data name="Data" />
</mesh>
<m2n:sockets from="A" to="B" exchange-directory="." />
<mesh name="B-Mesh" dimensions="3">
<use-data name="Data" />
</mesh>

<m2n:sockets acceptor="A" connector="B" exchange-directory="." />

<participant name="A">
<use-mesh name="A-Mesh" provide="yes" />
<write-data name="Data" mesh="A-Mesh" />
</participant>
<participant name="B">
<use-mesh name="A-Mesh" provide="no" from="A" />
<use-mesh name="B-Mesh" provide="yes" />
<read-data name="Data" mesh="B-Mesh" />
<participant name="A">
<provide-mesh name="A-Mesh" />
<write-data name="Data" mesh="A-Mesh" />
</participant>

<participant name="B">
<receive-mesh name="A-Mesh" from="A" />
<provide-mesh name="B-Mesh" />
<read-data name="Data" mesh="B-Mesh" />

<mapping:nearest-neighbor constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" />
<!-- <mapping:nearest-projection constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> -->
<!-- <mapping:rbf-compact-polynomial-c6 support-radius="0.1" use-qr-decomposition="false" constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> -->
<!-- <mapping:rbf-compact-polynomial-c6 support-radius="0.1" use-qr-decomposition="true" constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> -->
</participant>

<coupling-scheme:parallel-explicit>
<participants first="A" second="B" />
<max-time value="1.0" />
<time-window-size value="1" />
<exchange data="Data" mesh="A-Mesh" from="A" to="B" />
</coupling-scheme:parallel-explicit>

</solver-interface>
<mapping:nearest-neighbor constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" />
<!-- <mapping:nearest-projection constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" /> -->
<!-- <mapping:rbf-pum-direct constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" />
<basis-function:compact-polynomial-c6 support-radius="0.1" />
</mapping:rbf-pum-direct> -->
<!-- <mapping:rbf-global-direct constraint="consistent" direction="read" from="A-Mesh" to="B-Mesh" />
<basis-function:compact-polynomial-c6 support-radius="0.1" />
</mapping:rbf-global-direct> -->
</participant>

<coupling-scheme:parallel-explicit>
<participants first="A" second="B" />
<max-time value="1.0" />
<time-window-size value="1" />
<exchange data="Data" mesh="A-Mesh" from="A" to="B" />
</coupling-scheme:parallel-explicit>

</precice-configuration>
1 change: 1 addition & 0 deletions changelog-entries/318.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Replaced all `<use-mesh>` tags in every `precice-config.xml` file to `<provide-mesh>` and `<receive-mesh>` respectively.
1 change: 1 addition & 0 deletions changelog-entries/321.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Removed deprecated mapping timings from relevant preCICE configuration files
1 change: 1 addition & 0 deletions changelog-entries/331.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated the RBF mapping configuration according to recent breaking changes.
74 changes: 36 additions & 38 deletions channel-transport-reaction/precice-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,40 @@
enabled="true" />
</log>

<solver-interface dimensions="2">
<data:vector name="Velocity" />

<mesh name="Flow-Mesh">
<use-data name="Velocity" />
</mesh>

<mesh name="Chemical-Mesh">
<use-data name="Velocity" />
</mesh>

<participant name="Flow">
<use-mesh name="Flow-Mesh" provide="yes" />
<use-mesh name="Chemical-Mesh" from="Chemical" />
<write-data name="Velocity" mesh="Flow-Mesh" />
</participant>

<participant name="Chemical">
<use-mesh name="Chemical-Mesh" provide="yes" />
<use-mesh name="Flow-Mesh" from="Flow" />
<read-data name="Velocity" mesh="Chemical-Mesh" />
<mapping:linear-cell-interpolation
direction="read"
from="Flow-Mesh"
to="Chemical-Mesh"
constraint="consistent" />
</participant>

<m2n:sockets from="Flow" to="Chemical" exchange-directory=".." />

<coupling-scheme:serial-explicit>
<participants first="Flow" second="Chemical" />
<max-time value="5.0" />
<time-window-size value="0.05" />
<exchange data="Velocity" mesh="Flow-Mesh" from="Flow" to="Chemical" />

</coupling-scheme:serial-explicit>
</solver-interface>
<data:vector name="Velocity" />

<mesh name="Flow-Mesh" dimensions="2">
<use-data name="Velocity" />
</mesh>

<mesh name="Chemical-Mesh" dimensions="2">
<use-data name="Velocity" />
</mesh>

<participant name="Flow">
<provide-mesh name="Flow-Mesh" />
<receive-mesh name="Chemical-Mesh" from="Chemical" />
<write-data name="Velocity" mesh="Flow-Mesh" />
</participant>

<participant name="Chemical">
<provide-mesh name="Chemical-Mesh" />
<receive-mesh name="Flow-Mesh" from="Flow" />
<read-data name="Velocity" mesh="Chemical-Mesh" />
<mapping:linear-cell-interpolation
direction="read"
from="Flow-Mesh"
to="Chemical-Mesh"
constraint="consistent" />
</participant>

<m2n:sockets acceptor="Flow" connector="Chemical" exchange-directory=".." />

<coupling-scheme:serial-explicit>
<participants first="Flow" second="Chemical" />
<max-time value="5.0" />
<time-window-size value="0.05" />
<exchange data="Velocity" mesh="Flow-Mesh" from="Flow" to="Chemical" />

</coupling-scheme:serial-explicit>
</precice-configuration>
2 changes: 2 additions & 0 deletions channel-transport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Fluid participant:

* Nutils. For more information, have a look at the [Nutils adapter documentation](https://www.precice.org/adapter-nutils.html). This Nutils solver requires at least Nutils v7.0.

* OpenFOAM (pimpleFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html).

Transport participant:

* Nutils. For more information, have a look at the [Nutils adapter documentation](https://www.precice.org/adapter-nutils.html). This Nutils solver requires at least Nutils v7.0.
Expand Down
25 changes: 13 additions & 12 deletions channel-transport/fluid-nutils/fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def main():

print("Running utils")
print("Running Nutils")

# define the Nutils mesh
nx = 48
Expand Down Expand Up @@ -55,18 +55,18 @@ def main():
cons = solver.optimize(["u"], sqr, droptol=1e-15)

# preCICE setup
interface = precice.Interface("Fluid", "../precice-config.xml", 0, 1)
participant = precice.Participant("Fluid", "../precice-config.xml", 0, 1)

# define coupling mesh
mesh_name = "Fluid-Mesh"
mesh_id = interface.get_mesh_id(mesh_name)
vertices = gauss.eval(ns.x)
vertex_ids = interface.set_mesh_vertices(mesh_id, vertices)
vertex_ids = participant.set_mesh_vertices(mesh_name, vertices)

# coupling data
velocity_id = interface.get_data_id("Velocity", mesh_id)
data_name = "Velocity"

precice_dt = interface.initialize()
participant.initialize()
precice_dt = participant.get_max_time_step_size()

timestep = 0
dt = 0.005
Expand All @@ -76,14 +76,16 @@ def main():
# add convective term and time derivative for Navier-Stokes
ures += gauss.integral("ubasis_ni (dudt_i + μ (u_i u_j)_,j) d:x" @ ns)

while interface.is_coupling_ongoing():
while participant.is_coupling_ongoing():

if timestep % 1 == 0: # visualize
bezier = domain.sample("bezier", 2)
x, u, p = bezier.eval(["x_i", "u_i", "p"] @ ns, **state)
with log.add(log.DataLog()):
export.vtk("Fluid_" + str(timestep), bezier.tri, x, u=u, p=p)

precice_dt = participant.get_max_time_step_size()

# potentially adjust non-matching timestep sizes
dt = min(dt, precice_dt)

Expand All @@ -92,17 +94,16 @@ def main():
state["dt"] = dt
state = solver.newton(("u", "p"), (ures, pres), constrain=cons, arguments=state).solve(1e-10)

if interface.is_write_data_required(dt):
velocity_values = gauss.eval(ns.u, **state)
interface.write_block_vector_data(velocity_id, vertex_ids, velocity_values)
velocity_values = gauss.eval(ns.u, **state)
participant.write_data(mesh_name, data_name, vertex_ids, velocity_values)

# do the coupling
precice_dt = interface.advance(dt)
participant.advance(dt)

# advance variables
timestep += 1

interface.finalize()
participant.finalize()


if __name__ == "__main__":
Expand Down
39 changes: 39 additions & 0 deletions channel-transport/fluid-openfoam/0/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}

dimensions [0 1 -1 0 0 0 0];
internalField uniform (10 0 0);

boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
obstacle
{
type noSlip;
}
upperWall
{
type noSlip;
}
lowerWall
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
Loading