Skip to content

Commit

Permalink
Merge branch 'precice:develop' into solid-fake
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasVin authored Jun 28, 2024
2 parents 8686c5e + 32b2671 commit b71da70
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ out
precice-profiling/
precice-run/
core
precice-*-events.json
profiling.json
profiling.csv
trace.json

# C++
*.o
Expand Down
12 changes: 2 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,9 @@ repos:
rev: v0.30.0
hooks:
- id: markdownlint
exclude: |
(?x)^(
changelog-entries|
.github/pull_request_template.md
)$
exclude: ^(.github/pull_request_template.md|changelog-entries)
- id: markdownlint-fix
exclude: |
(?x)^(
changelog-entries|
.github/pull_request_template.md
)$
exclude: ^(.github/pull_request_template.md|changelog-entries)
- repo: https://github.com/hhatto/autopep8
rev: v2.0.4
hooks:
Expand Down
1 change: 1 addition & 0 deletions changelog-entries/544.md
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.
1 change: 1 addition & 0 deletions changelog-entries/545.md
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).
12 changes: 6 additions & 6 deletions quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ To get a feeling what preCICE does, watch a [short presentation](https://www.you
```bash
# Add the signing key, add the repository, update (check this):
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash
# Install OpenFOAM v2312:
sudo apt install openfoam2312-dev
# Install OpenFOAM v2406:
sudo apt install openfoam2406-dev
# Enable OpenFOAM by default in your system and apply now:
echo "source /usr/lib/openfoam/openfoam2312/etc/bashrc" >> ~/.bashrc
echo "source /usr/lib/openfoam/openfoam2406/etc/bashrc" >> ~/.bashrc
source ~/.bashrc
```

Expand All @@ -55,9 +55,9 @@ To get a feeling what preCICE does, watch a [short presentation](https://www.you
4. Download and install the [OpenFOAM-preCICE adapter](https://precice.org/adapter-openfoam-get.html):

```bash
wget https://github.com/precice/openfoam-adapter/archive/refs/tags/v1.3.0.tar.gz
tar -xzf v1.3.0.tar.gz
cd openfoam-adapter-1.3.0/
wget https://github.com/precice/openfoam-adapter/archive/refs/tags/v1.3.1.tar.gz
tar -xzf v1.3.1.tar.gz
cd openfoam-adapter-1.3.1/
./Allwmake
cd ..
```
Expand Down
16 changes: 8 additions & 8 deletions resonant-circuit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ summary: We simulate a two-element LC circuit (one inductor and one capacitor).

## Setup

The purpose of this tutorial is to illustrate the usage of preCICE to couple MATLAB code. Two different MATLAB solvers will be coupled to simulate a two-element LC circuit. This type of circuit consists on a very simple system with one inductor and one capacitor:
The purpose of this tutorial is to illustrate the usage of preCICE to couple MATLAB code. Two different MATLAB solvers will be coupled to simulate a two-element LC circuit. This type of circuit consists of a very simple system with one inductor and one capacitor:

![LC circuit diagram [1]](images/tutorials-resonant-circuit-diagram.svg)

Expand All @@ -17,9 +17,9 @@ $U(t) = L \frac{\text{d}I}{\text{d}t}$

$I(t) = -C \frac{\text{d}U}{\text{d}t}$

where $I$ is the current and $U$ the voltage of the cirucit.
where $I$ is the current and $U$ the voltage of the circuit.

Each of these equations is going to be solved by a different MATLAB solver. Note that as only one scalar is solved per equation, this is a 0+1 dimensional problem.
Each of these equations is going to be solved by a different MATLAB solver. Note that, as only one scalar is solved per equation, this is a 0+1 dimensional problem.

## Configuration

Expand All @@ -36,23 +36,23 @@ preCICE configuration (image generated using the [precice-config-visualizer](htt

### MATLAB

For running this example, first get into one of folders with the solvers and open a MATLAB instance.
For running this example, first get into one of the solver folders and open a MATLAB instance.
Afterward, do the same for the second solver.
After adding the MATLAB bindings to the MATLAB path (in both instances), run the following commands:

In the first MATLAB instance one can run the solver for the current:
In the first MATLAB instance, one can run the solver for the current:

```MATLAB
coil
```

And in the second MATLAB instance the solver for the voltage:
And in the second MATLAB instance, the solver for the voltage:

```MATLAB
capacitor
```

The preCICE configuration file is available as `precice-config.xml`, and it is called directly in the solvers.
The preCICE configuration file is hard-coded as `precice-config.xml` in the solvers.

#### Running from terminal

Expand All @@ -67,7 +67,7 @@ The solver for the current also records the current and voltage through time and

After successfully running the coupling, one can find the curves in the folder `capacitor-matlab` as `Curves.png`.

The `Curves.png` plot could exemplarily look like the following:
Example of a `Curves.png` plot:
![Voltage and current plot of the resonant circuit](images/tutorials-resonant-circuit-curves.png)

## References
Expand Down
4 changes: 3 additions & 1 deletion volume-coupled-flow/fluid-openfoam/constant/fvOptions
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ codedSource
for(auto cell : cells)
{
fld[cell].x() = U_vol[cell].x();
fld[cell].y() = U_vol[cell].y();
fld[cell].z() = U_vol[cell].z();
}
#};

Expand All @@ -39,4 +41,4 @@ codedSource
#{
return;
#};
}
}
Binary file modified 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.

0 comments on commit b71da70

Please sign in to comment.