diff --git a/perpendicular-flap/metadata.yaml b/perpendicular-flap/metadata.yaml index 6aebd8fad..e0b06f17d 100644 --- a/perpendicular-flap/metadata.yaml +++ b/perpendicular-flap/metadata.yaml @@ -73,8 +73,8 @@ cases: run: ./run.sh component: openfoam-adapter - # solid-solids4foam: - # participant: Solid - # directory: ./solid-solids4foam - # run: ./run.sh - # component: openfoam-adapter + solid-solids4foam: + participant: Solid + directory: ./solid-solids4foam + run: ./run.sh + component: solids4foam diff --git a/perpendicular-flap/reference-results/fluid-openfoam_solid-solids4foam.tar.gz b/perpendicular-flap/reference-results/fluid-openfoam_solid-solids4foam.tar.gz new file mode 100644 index 000000000..1f60848fd --- /dev/null +++ b/perpendicular-flap/reference-results/fluid-openfoam_solid-solids4foam.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e4d0f83bc001b8ccd6eecda3b77f5b6a9b8b1c1dd36b42bbb0ae055181db6c +size 23231 diff --git a/perpendicular-flap/reference-results/reference_results.metadata b/perpendicular-flap/reference-results/reference_results.metadata index 50e165dc1..5e1addbd8 100644 --- a/perpendicular-flap/reference-results/reference_results.metadata +++ b/perpendicular-flap/reference-results/reference_results.metadata @@ -11,7 +11,7 @@ We also include some information on the machine used to generate them | name | time | sha256 | |------|------|-------| -| fluid-openfoam_solid-dune.tar.gz | 2026-07-08 13:13:57 | 06408d6dac453863c981a733defbe3bc807f1bc2fb15d04f2551060dd010692b | +| fluid-openfoam_solid-solids4foam.tar.gz | 2026-07-10 18:05:57 | 29e4d0f83bc001b8ccd6eecda3b77f5b6a9b8b1c1dd36b42bbb0ae055181db6c | ## List of arguments used to generate the files @@ -19,8 +19,9 @@ We also include some information on the machine used to generate them |------|------| | PLATFORM | ubuntu_2404 | | CALCULIX_VERSION | 2.20 | -| DUNE_VERSION | 2.9 | | DUMUX_VERSION | 3.7 | +| DUNE_VERSION_DUMUX | 2.9 | +| DUNE_VERSION_DUNE | 2.9 | | OPENFOAM_EXECUTABLE | openfoam2512 | | SU2_VERSION | 7.5.1 | | FENICS_ADAPTER_REF | v2.3.0 | @@ -28,13 +29,14 @@ We also include some information on the machine used to generate them | FMI_RUNNER_REF | v0.2.1 | | CALCULIX_ADAPTER_REF | v2.20.1 | | DEALII_ADAPTER_REF | a421d92 | +| DUNE_ADAPTER_REF | 778d3bb | | DUMUX_ADAPTER_REF | 3f3f54f | | MICRO_MANAGER_REF | bf5ea7b | | OPENFOAM_ADAPTER_REF | 2c3062c | | PRECICE_REF | b770460f2447b94da430086085d6b424e7c073e9 | | PYTHON_BINDINGS_REF | v3.4.0 | | SU2_ADAPTER_REF | 5abe79b | -| TUTORIALS_REF | 54cd04a8e5aa8f4efdce53785d298c115e7e287a | +| TUTORIALS_REF | d7b5ca1cd4219d42441c5b3266d741dcf70e706e | | PRECICE_PRESET | production-audit | | PRECICE_UID | 1003 | | PRECICE_GID | 1003 | diff --git a/perpendicular-flap/solid-solids4foam/system/fvSchemes b/perpendicular-flap/solid-solids4foam/system/fvSchemes index 87d288970..842fba231 100644 --- a/perpendicular-flap/solid-solids4foam/system/fvSchemes +++ b/perpendicular-flap/solid-solids4foam/system/fvSchemes @@ -18,7 +18,7 @@ ddtSchemes gradSchemes { - default extendedLeastSquares 0; + default leastSquaresS4f 0; } divSchemes @@ -46,6 +46,6 @@ interpolationSchemes interpolate(impK) linear; interpolate(grad(D)) linear; interpolate(grad(DD)) linear; - interpolate(sigma0) linear; + interpolate(sigma) linear; } diff --git a/tools/tests/component-templates/solids4foam.yaml b/tools/tests/component-templates/solids4foam.yaml new file mode 100644 index 000000000..23ed3920d --- /dev/null +++ b/tools/tests/component-templates/solids4foam.yaml @@ -0,0 +1,16 @@ +build: + context: {{ dockerfile_context }} + args: + {% for key, value in build_arguments.items() %} + - {{key}}={{value}} + {% endfor %} + target: solids4foam +depends_on: + prepare: + condition: service_completed_successfully +volumes: + - {{ run_directory }}:/runs +command: > + /bin/bash -c "id && + cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && + openfoam {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 38e73b0c7..658b1d826 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -90,6 +90,22 @@ dune-adapter: repository: https://github.com/precice/dune-adapter default: "main" + +solids4foam: + repository: https://github.com/solids4foam/solids4foam + template: component-templates/solids4foam.yaml + build_arguments: + PLATFORM: + description: Dockerfile platform used + default: "ubuntu_2404" + # The name "PLATFORM" is misleading: For this component, we use a different base image. + TUTORIALS_REF: + description: Tutorial git reference to use + default: "master" + OPENFOAM_ADAPTER_REF: + description: Reference/tag of the OpenFOAM adapter to use + default: "master" + fenics-adapter: template: component-templates/fenics-adapter.yaml build_arguments: diff --git a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile index 1da2ef2a7..4a5ed8b6e 100644 --- a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile +++ b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile @@ -560,4 +560,63 @@ RUN cd /home/precice/aste && \ make all install -j $(nproc) && \ cd ../.. && rm -rf aste -WORKDIR /home/precice \ No newline at end of file +WORKDIR /home/precice + + +FROM solids4foam/solids4foam:v2.3-openfoam-v2412-latest as solids4foam + +ARG PRECICE_UID=1000 +ARG PRECICE_GID=1000 +ARG OPENFOAM_ADAPTER_PR +ARG OPENFOAM_ADAPTER_REF + +USER root +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +# Set the same user as the rest of the system tests components, for consistency. +RUN set -eux; \ + if getent group "${PRECICE_GID}" >/dev/null; then \ + existing_group="$(getent group "${PRECICE_GID}" | cut -d: -f1)"; \ + if [ "${existing_group}" != "precice" ]; then \ + groupmod -n precice "${existing_group}"; \ + fi; \ + else \ + groupadd -g "${PRECICE_GID}" precice; \ + fi; \ + if getent passwd "${PRECICE_UID}" >/dev/null; then \ + existing_user="$(getent passwd "${PRECICE_UID}" | cut -d: -f1)"; \ + if [ "${existing_user}" != "precice" ]; then \ + usermod -l precice -d /home/precice -m "${existing_user}"; \ + fi; \ + usermod -g "${PRECICE_GID}" precice; \ + else \ + useradd -u "${PRECICE_UID}" -g "${PRECICE_GID}" -ms /bin/bash precice; \ + fi; \ + mkdir -p /home/precice; \ + chown -R "${PRECICE_UID}:${PRECICE_GID}" /home/precice + +# The base image provides all binaries under /root/, but we prefer to build as a regular user. +RUN mv /root/OpenFOAM/ /home/precice/OpenFOAM/ && \ + chown -R "${PRECICE_UID}:${PRECICE_GID}" /home/precice/OpenFOAM + +# Set a general openfoam executable, to make the component template version-independent +RUN ln -sf /usr/bin/openfoam2412 /usr/bin/openfoam + +RUN apt-get -qq update && \ + apt-get -qq -y install wget git + +# preCICE v3.4 was the last release to support Ubuntu 22.04 (used as a base image), +# so there is no reason to accept the preCICE version as an argument and build it from source. +# Rework this part once a newer base image is used. +RUN wget https://github.com/precice/precice/releases/download/v3.4.1/libprecice3_3.4.1_jammy.deb && \ + apt-get -qq -y install ./libprecice3_3.4.1_jammy.deb + +USER precice +WORKDIR /home/precice + +RUN git clone https://github.com/precice/openfoam-adapter.git &&\ + cd openfoam-adapter && \ + if [ -n "${OPENFOAM_ADAPTER_PR}" ]; then git fetch origin pull/${OPENFOAM_ADAPTER_PR}/head; fi && \ + git checkout ${OPENFOAM_ADAPTER_REF} && \ + /usr/bin/openfoam2412 ./Allwmake -j $(nproc) \ No newline at end of file diff --git a/tools/tests/tests.yaml b/tools/tests/tests.yaml index 65e6246a6..23820780a 100644 --- a/tools/tests/tests.yaml +++ b/tools/tests/tests.yaml @@ -505,6 +505,13 @@ test_suites: - solid-openfoam max_time: 0.03 reference_result: ./perpendicular-flap/reference-results/fluid-openfoam_solid-openfoam.tar.gz + - &perpendicular-flap_fluid-openfoam_solid-solids4foam + path: perpendicular-flap + case_combination: + - fluid-openfoam + - solid-solids4foam + max_time: 0.1 + reference_result: ./perpendicular-flap/reference-results/fluid-openfoam_solid-solids4foam.tar.gz - &perpendicular-flap_fluid-su2_solid-fenics path: perpendicular-flap case_combination: @@ -882,6 +889,10 @@ test_suites: - *partitioned-heat-conduction-mixedbc_left-openfoam_right-openfoam - *partitioned-heat-conduction-robin_left-openfoam_right-openfoam + solids4foam: + tutorials: + - *perpendicular-flap_fluid-openfoam_solid-solids4foam + su2-adapter: tutorials: - *flow-over-heated-plate_fluid-su2_solid-openfoam