Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
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
10 changes: 5 additions & 5 deletions perpendicular-flap/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions perpendicular-flap/solid-solids4foam/system/fvSchemes
Comment thread
MakisH marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ddtSchemes

gradSchemes
{
default extendedLeastSquares 0;
default leastSquaresS4f 0;
}

divSchemes
Expand Down Expand Up @@ -46,6 +46,6 @@ interpolationSchemes
interpolate(impK) linear;
interpolate(grad(D)) linear;
interpolate(grad(DD)) linear;
interpolate(sigma0) linear;
interpolate(sigma) linear;
}

16 changes: 16 additions & 0 deletions tools/tests/component-templates/solids4foam.yaml
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 16 additions & 0 deletions tools/tests/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
64 changes: 64 additions & 0 deletions tools/tests/dockerfiles/ubuntu_2404/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,67 @@ RUN cd "${SU2_HOME}" &&\
./meson.py build -Denable-pywrapper=true --prefix=$SU2_RUN &&\
./ninja -C build install
### end of su2_adapter stage ###


#####################################################################
# Build stages using third-party base images #
#####################################################################


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)
2 changes: 1 addition & 1 deletion tools/tests/reference_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OPENFOAM_ADAPTER_REF: "2c3062c" # develop, May 27, 2026
PRECICE_REF: "v3.4.1"
PYTHON_BINDINGS_REF: "v3.4.0"
SU2_ADAPTER_REF: "5abe79b" # develop, May 27, 2026
TUTORIALS_REF: "develop"
TUTORIALS_REF: "solids4foam-component"

# Additional settings
PRECICE_PRESET: "production-audit"
11 changes: 11 additions & 0 deletions tools/tests/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,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:
Expand Down Expand Up @@ -868,6 +875,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
Expand Down