diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index cfdecee79..f7e0ce616 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -1,5 +1,5 @@ -name: Check links -on: [push, pull_request] +name: Check links (manual) +on: workflow_dispatch jobs: check_links: runs-on: ubuntu-latest diff --git a/.markdown-link-check-config.json b/.markdown-link-check-config.json index ec8d5c1b1..26440a7b8 100644 --- a/.markdown-link-check-config.json +++ b/.markdown-link-check-config.json @@ -1,3 +1,11 @@ { - "aliveStatusCodes": [429, 403, 200] -} \ No newline at end of file + "aliveStatusCodes": [429, 200], + "ignorePatterns": [ + { + "pattern": "^https://openfoamwiki.net/" + }, + { + "pattern": "^https://doi.org/" + } + ] +} diff --git a/.markdownlint.json b/.markdownlint.json index 151ee39b6..e12067088 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,4 +1,4 @@ { "MD013": false, "MD033": false -} \ No newline at end of file +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..ce28660e6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,58 @@ +# preCICE tutorials changelog + +All notable changes to this repository will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + + + +## [Unreleased] + +## [v202202.0] 2022-02-09 + +### Added + +- Added new volume-coupled-diffusion tutorial with FEniCS [#219](https://github.com/precice/tutorials/pull/219). +- Added OpenFOAM case to partiitoned-heat [#223](https://github.com/precice/tutorials/pull/223). +- Added DUNE case to perpendicular-flap [#239](https://github.com/precice/tutorials/pull/239). +- Added FEniCS case to elastic-tube-3d [#223](https://github.com/precice/tutorials/pull/223). +- Added this changelog, describing also changes in previous releases [#225](https://github.com/precice/tutorials/pull/225). + +### Changed + +- Changed C3D8 elements to C3D8I elements in perpendicular-flap solid-calculix to improve the results [#250](https://github.com/precice/tutorials/pull/250). +- Ported the `visualize.py` script of the partitioned-elastic-beam to Python 3 [#247](https://github.com/precice/tutorials/pull/247). +- Reduced the writing frequency of the partitioned-pipe OpenFOAM cases [#257](https://github.com/precice/tutorials/pull/257). +- Renamed the output directories of all FEniCS cases for consistency [#256](https://github.com/precice/tutorials/pull/257). +- Removed unnecessary (wrong) read statment in `elastic-tube-1d` [#232](https://github.com/precice/tutorials/pull/232). +- Removed unnecessary (relic) OpenFOAM parameter `nMoles` from flow-over-heated-plate cases with OpenFOAM [#234](https://github.com/precice/tutorials/pull/234). +- Removed unnecessary (relic) OpenFOAM parameter `RAS` from the `turbulenceProperties` files of all OpenFOAM cases (we model a laminar flow everywhere and this was confusing) [#258](https://github.com/precice/tutorials/pull/258). +- Removed unnecessary (relic) OpenFOAM files `RASProperties` and `couplingProperties` from elastic-tube-3d [#258](https://github.com/precice/tutorials/pull/258). +- Removed unnecessary (relic) OpenFOAM file `radiationProperties` from heat-exchanger [#258](https://github.com/precice/tutorials/pull/258). +- Removed duplicate default settings from the `fvSchemes` OpenFOAM file of the heat-exchanger [#258](https://github.com/precice/tutorials/pull/258). +- Removed unnecessary (relic) fields and inaccurate copyright notices from the headers of several OpenFOAM files [#258](https://github.com/precice/tutorials/pull/258). +- Adjusted the formatting in several OpenFOAM files [#258](https://github.com/precice/tutorials/pull/258). +- Changed the versioning scheme from `..` to `.`. + +## [v202104.1.1] 2021-05-02 + +### Changed + +- Modified the helper tool `openfoam_remove_empty_dirs` such that it also respects results in the compressed OpenFOAM format (76f4482). +- Synced the post-processing functionality of the elastic-tube-1d and the respective documentation. (#209) + +## [v202104.1.0] 2021-04-23 + +### Added + +- Created a first tagged version of this repository along with a [release](https://github.com/precice/tutorials/releases/tag/v202104.1.0). +- Added a standard run script in each case folder which can be executed as `./run.sh`. +- Added a standard clean script in each case folder which can be executed as `./clean.sh`. +- Added an easy-to-run tutorial called [quickstart](https://precice.org/quickstart.html). +- Added a validated Turek-Hron FSI3 case with OpenFOAM and non-linear deal.II. + +### Changed + +- Moved all documentation to the [redesigned preCICE website](https://precice.org/tutorials.html). +- Created a new directory structure for easy access and also for [contributions](https://precice.org/community-contribute-to-precice.html). +- Modified the 2D cases to use 2D mode in preCICE and also corresponding 2D functionality in the adapters. diff --git a/README.md b/README.md index 6e5b5b0f9..a80f1f0a8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # preCICE tutorials -This repository contains ready-to-run tutorial cases for the coupling library [preCICE](http://www.precice.org/). -The purpose of these cases is not to teach you how to use preCICE from scratch, but to serve as starting points for setting up similar simulation cases, as well as test cases. Read more on our [preCICE tutorials](https://www.precice.org/tutorials.html) documentation section. +This repository contains ready-to-run tutorial cases for the coupling library [preCICE](https://precice.org/). +The purpose of these cases is not to teach you how to use preCICE from scratch, but to serve as starting points for setting up similar simulation cases, as well as test cases. Read more on our [preCICE tutorials](https://precice.org/tutorials.html) documentation section. As a general rule, you can start each participant from inside their `/-` using `./run.sh`. Look into these short scripts and copy the parts you need for your new case. Before running again, execute the cleaning scripts you can find at each level, to clean from this point and deeper. diff --git a/elastic-tube-1d/fluid-cpp/src/FluidSolver.cpp b/elastic-tube-1d/fluid-cpp/src/FluidSolver.cpp index 5010c2cf7..88c99d551 100644 --- a/elastic-tube-1d/fluid-cpp/src/FluidSolver.cpp +++ b/elastic-tube-1d/fluid-cpp/src/FluidSolver.cpp @@ -101,10 +101,6 @@ int main(int argc, char **argv) interface.markActionFulfilled(actionWriteIterationCheckpoint()); } - if (interface.isReadDataAvailable()) { - interface.readBlockScalarData(crossSectionLengthID, chunkLength, vertexIDs.data(), crossSectionLength.data()); - } - fluidComputeSolutionSerial( // values from last time window velocity_old.data(), pressure_old.data(), crossSectionLength_old.data(), diff --git a/elastic-tube-3d/README.md b/elastic-tube-3d/README.md index 4196c7dd5..0497decbf 100644 --- a/elastic-tube-3d/README.md +++ b/elastic-tube-3d/README.md @@ -1,7 +1,7 @@ --- title: Elastic tube 3D permalink: tutorials-elastic-tube-3d.html -keywords: FSI, OpenFOAM, CalculiX, nearest-projection, IMVJ +keywords: FSI, OpenFOAM, CalculiX, FEniCS, nearest-projection, IMVJ summary: Tutorial for an FSI simulation of a three-dimensional expanding tube scenario --- @@ -19,15 +19,17 @@ The expanding tube test case comes with the interface surface mesh connectivity Fluid participant: -* OpenFOAM. This tutorial is known to work with OpenFOAM 4.1, 5.0, but it should also work with newer versions. The case files are prepared for the latest versions of OpenFOAM and use the solver `pimpleFoam`. In case you are using a previous OpenFOAM version you need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). +* OpenFOAM (pimpleFoam). In case you are using a very old OpenFOAM version, you will need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). Solid participant: -* CalculiX. This tutorial is known to work with CalculiX 2.15, but it should also work with newer versions. For more information, have a look at the [CalculiX adapter documentation](https://www.precice.org/adapter-calculix-overview.html). +* CalculiX. For more information, have a look at the [CalculiX adapter documentation](https://www.precice.org/adapter-calculix-overview.html). + +* FEniCS. The structural model is currently limited to linear elasticity. Currently 3D functionality is experimental in the FEniCS adapter and more details can be found [here](https://github.com/precice/fenics-adapter/pull/133) For more information, have a look at the [FeniCS adapter documentation](https://www.precice.org/adapter-fenics.html). ## Running the simulation -You can start the simulation by running the script `./run.sh` located in each participant directory. OpenFOAM can be executed in parallel by using an additional `run.sh -parallel` flag. The default setting uses 4 MPI ranks. +You can start the simulation by running the script `./run.sh` located in each participant directory. OpenFOAM can be executed in parallel using `run.sh -parallel`. The default setting uses 4 MPI ranks. ## Post-processing @@ -35,6 +37,10 @@ You can visualize the results using paraView or `cgx`(for native CalculiX resul ![result tube](images/tutorials-elastic-tube-3d-tube-result.png) +You can also plot the displacement of the midpoint of the tube by running `sh plot-displacement.sh `. The displacement plot for each solver combination looks like: + +![plot tube](images/tutorials-elastic-tube-3d-plot.png) + {% disclaimer %} This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks. {% enddisclaimer %} diff --git a/elastic-tube-3d/fluid-openfoam/0/U b/elastic-tube-3d/fluid-openfoam/0/U index 8abd00144..a10aef64b 100755 --- a/elastic-tube-3d/fluid-openfoam/0/U +++ b/elastic-tube-3d/fluid-openfoam/0/U @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -28,6 +26,3 @@ boundaryField type zeroGradient; } } - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/0/p b/elastic-tube-3d/fluid-openfoam/0/p index e67f29f41..0eafdccae 100755 --- a/elastic-tube-3d/fluid-openfoam/0/p +++ b/elastic-tube-3d/fluid-openfoam/0/p @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -17,13 +15,13 @@ boundaryField auto0 { type uniformFixedValue; - uniformValue table - ( - (0 1.3332) - (3e-3 1.3332) - (3.1e-3 0) - (1e-2 0) - ); + uniformValue table + ( + (0 1.3332) + (3e-3 1.3332) + (3.1e-3 0) + (1e-2 0) + ); } interface { @@ -35,6 +33,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/0/pointDisplacement b/elastic-tube-3d/fluid-openfoam/0/pointDisplacement index 1aaaaeef9..7d8b966f7 100644 --- a/elastic-tube-3d/fluid-openfoam/0/pointDisplacement +++ b/elastic-tube-3d/fluid-openfoam/0/pointDisplacement @@ -5,7 +5,6 @@ FoamFile class pointVectorField; object pointDisplacement; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; @@ -21,7 +20,7 @@ boundaryField interface { - type fixedValue; + type fixedValue; value $internalField; } @@ -32,6 +31,3 @@ boundaryField } } - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/RASProperties b/elastic-tube-3d/fluid-openfoam/constant/RASProperties deleted file mode 100644 index c383a2b59..000000000 --- a/elastic-tube-3d/fluid-openfoam/constant/RASProperties +++ /dev/null @@ -1,16 +0,0 @@ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object RASProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -RASModel laminar; - -turbulence off; - -printCoeffs on; - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/couplingProperties b/elastic-tube-3d/fluid-openfoam/constant/couplingProperties deleted file mode 100644 index 1c5a03ce6..000000000 --- a/elastic-tube-3d/fluid-openfoam/constant/couplingProperties +++ /dev/null @@ -1,15 +0,0 @@ -FoamFile -{ - version 2.0; - format ascii; - root ""; - case ""; - instance ""; - local ""; - class dictionary; - object couplingProperties; -} - -movingSolidPatches (auto1); - -movingFluidPatches (auto1); diff --git a/elastic-tube-3d/fluid-openfoam/constant/dynamicMeshDict b/elastic-tube-3d/fluid-openfoam/constant/dynamicMeshDict index fb7e15ef2..d49c2d241 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/dynamicMeshDict +++ b/elastic-tube-3d/fluid-openfoam/constant/dynamicMeshDict @@ -2,18 +2,10 @@ FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object motionProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ( "libfvMotionSolvers.so" ); diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/boundary b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/boundary index e1aa017d9..2c571265b 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/boundary +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/boundary @@ -6,7 +6,6 @@ FoamFile location "constant/polyMesh"; object boundary; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 3 ( @@ -29,5 +28,3 @@ FoamFile startFace 67196; } ) - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/cellZones b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/cellZones index 0fbd79ea5..f382205d8 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/cellZones +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/cellZones @@ -6,9 +6,6 @@ FoamFile location "constant/polyMesh"; object cellZones; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 0 () - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faceZones b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faceZones index 2879fc837..9603e9eeb 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faceZones +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faceZones @@ -6,9 +6,6 @@ FoamFile location "constant/polyMesh"; object faceZones; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 0 () - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faces b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faces index fdfa43a10..1371f4287 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faces +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/faces @@ -6,8 +6,6 @@ FoamFile location "constant/polyMesh"; object faces; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - 67367 ( @@ -67379,6 +67377,3 @@ FoamFile 3(223 230 222) 3(232 225 233) ) - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/neighbour b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/neighbour index 5a6e2315f..2495145ee 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/neighbour +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/neighbour @@ -7,8 +7,6 @@ FoamFile location "constant/polyMesh"; object neighbour; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - 63397 ( @@ -63410,6 +63408,3 @@ FoamFile 32690 32690 ) - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/owner b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/owner index b48b8b378..f6bc9c468 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/owner +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/owner @@ -7,8 +7,6 @@ FoamFile location "constant/polyMesh"; object owner; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - 67367 ( @@ -67380,6 +67378,3 @@ FoamFile 32352 32685 ) - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/pointZones b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/pointZones index a0a8bd443..2e6430973 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/pointZones +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/pointZones @@ -6,9 +6,6 @@ FoamFile location "constant/polyMesh"; object pointZones; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 0 () - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/points b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/points index 554f3f9f1..f2c95f414 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/points +++ b/elastic-tube-3d/fluid-openfoam/constant/polyMesh.orig/points @@ -6,8 +6,6 @@ FoamFile location "constant/polyMesh"; object points; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - 6598 ( @@ -6610,6 +6608,3 @@ FoamFile (-0.00056456403382237 0.0027208575300533 0.017526220021498) (-0.0033003515528103 0.0026852032948362 0.001388666491757) ) - - -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/constant/transportProperties b/elastic-tube-3d/fluid-openfoam/constant/transportProperties index a10b59d7c..c12193e79 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/transportProperties +++ b/elastic-tube-3d/fluid-openfoam/constant/transportProperties @@ -3,12 +3,9 @@ FoamFile version 2.0; format ascii; class dictionary; - object flowProperties; + object transportProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu nu [0 2 -1 0 0 0 0] 3e-6; -transportModel Newtonian; - -// ************************************************************************* // +transportModel Newtonian; diff --git a/elastic-tube-3d/fluid-openfoam/constant/turbulenceProperties b/elastic-tube-3d/fluid-openfoam/constant/turbulenceProperties index 23f972c18..9789bb1f6 100644 --- a/elastic-tube-3d/fluid-openfoam/constant/turbulenceProperties +++ b/elastic-tube-3d/fluid-openfoam/constant/turbulenceProperties @@ -1,13 +1,9 @@ FoamFile { - version 2.0; - format ascii; - root ""; - case ""; - instance ""; - local ""; - class dictionary; - object turbulenceProperties; + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; } simulationType laminar; diff --git a/elastic-tube-3d/fluid-openfoam/system/controlDict b/elastic-tube-3d/fluid-openfoam/system/controlDict index 4247dc635..8a0e989eb 100755 --- a/elastic-tube-3d/fluid-openfoam/system/controlDict +++ b/elastic-tube-3d/fluid-openfoam/system/controlDict @@ -1,18 +1,13 @@ - FoamFile { - version 2.0; - format ascii; - root ""; - case ""; - instance ""; - local ""; - class dictionary; - object controlDict; + version 2.0; + format ascii; + class dictionary; + object controlDict; } -application pimpleFoam; -//application pimpleDyMFoam; +application pimpleFoam; // latest OpenFOAM +// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older startFrom startTime; diff --git a/elastic-tube-3d/fluid-openfoam/system/decomposeParDict b/elastic-tube-3d/fluid-openfoam/system/decomposeParDict index 121fc8f17..eecf99e23 100755 --- a/elastic-tube-3d/fluid-openfoam/system/decomposeParDict +++ b/elastic-tube-3d/fluid-openfoam/system/decomposeParDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object decomposeParDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 4; method simple; @@ -14,6 +13,4 @@ simpleCoeffs { n (4 1 1); delta 0.001; - } -// ************************************************************************* // diff --git a/elastic-tube-3d/fluid-openfoam/system/fvSchemes b/elastic-tube-3d/fluid-openfoam/system/fvSchemes index 504047272..e69974eb5 100755 --- a/elastic-tube-3d/fluid-openfoam/system/fvSchemes +++ b/elastic-tube-3d/fluid-openfoam/system/fvSchemes @@ -7,72 +7,72 @@ FoamFile object fvSchemes; } - ddtSchemes - { - default Euler; - } +ddtSchemes +{ + default Euler; +} - gradSchemes - { - default Gauss linear; - grad(U) leastSquares; - grad(nuTilda) cellLimited Gauss linear 1; - grad(k) cellLimited Gauss linear 1; - grad(kl) cellLimited Gauss linear 1; - grad(omega) cellLimited Gauss linear 1; - grad(epsilon) cellLimited Gauss linear 1; - grad(q) cellLimited Gauss linear 1; - grad(zeta) cellLimited Gauss linear 1; - grad(v2) cellLimited Gauss linear 1; - grad(f) cellLimited Gauss linear 1; - grad(sqrt(kt)) cellLimited Gauss linear 1; - grad(kt) cellLimited Gauss linear 1; - grad(sqrt(kl)) cellLimited Gauss linear 1; - } +gradSchemes +{ + default Gauss linear; + grad(U) leastSquares; + grad(nuTilda) cellLimited Gauss linear 1; + grad(k) cellLimited Gauss linear 1; + grad(kl) cellLimited Gauss linear 1; + grad(omega) cellLimited Gauss linear 1; + grad(epsilon) cellLimited Gauss linear 1; + grad(q) cellLimited Gauss linear 1; + grad(zeta) cellLimited Gauss linear 1; + grad(v2) cellLimited Gauss linear 1; + grad(f) cellLimited Gauss linear 1; + grad(sqrt(kt)) cellLimited Gauss linear 1; + grad(kt) cellLimited Gauss linear 1; + grad(sqrt(kl)) cellLimited Gauss linear 1; +} - divSchemes - { - default Gauss linear; - div(phi,U) Gauss linearUpwindV leastSquares; - div(phi,k) Gauss linearUpwind cellLimited Gauss linear 1; - div(phi,epsilon) bounded Gauss linearUpwind grad(epsilon); - div(phi,zeta) bounded Gauss linearUpwind grad(zeta); - div(phi,q) bounded Gauss linearUpwind grad(q); - div(phi,omega) bounded Gauss linearUpwind grad(omega); - div(phi,nuTilda) bounded Gauss linearUpwind grad(nuTilda); - div(phi,T) bounded Gauss limitedLinear 1; - div(phi,kl) Gauss limitedLinear 1; - div(phi,kt) Gauss limitedLinear 1; - div(phi,R) Gauss upwind; - div(R) Gauss linear; - div((nuEff*dev(grad(U).T()))) Gauss linear; - div(phi,v2) bounded Gauss linearUpwind grad(v2); - div(phi,f) bounded Gauss linearUpwind grad(f); - } +divSchemes +{ + default Gauss linear; + div(phi,U) Gauss linearUpwindV leastSquares; + div(phi,k) Gauss linearUpwind cellLimited Gauss linear 1; + div(phi,epsilon) bounded Gauss linearUpwind grad(epsilon); + div(phi,zeta) bounded Gauss linearUpwind grad(zeta); + div(phi,q) bounded Gauss linearUpwind grad(q); + div(phi,omega) bounded Gauss linearUpwind grad(omega); + div(phi,nuTilda) bounded Gauss linearUpwind grad(nuTilda); + div(phi,T) bounded Gauss limitedLinear 1; + div(phi,kl) Gauss limitedLinear 1; + div(phi,kt) Gauss limitedLinear 1; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div((nuEff*dev(grad(U).T()))) Gauss linear; + div(phi,v2) bounded Gauss linearUpwind grad(v2); + div(phi,f) bounded Gauss linearUpwind grad(f); +} - interpolationSchemes - { - default linear; - interpolate(HbyA) linear; - } +interpolationSchemes +{ + default linear; + interpolate(HbyA) linear; +} - laplacianSchemes - { - default Gauss linear limited 0.333; - } +laplacianSchemes +{ + default Gauss linear limited 0.333; +} - snGradSchemes - { - default limited 0.333; - } +snGradSchemes +{ + default limited 0.333; +} - wallDist - { - method meshWave; - } +wallDist +{ + method meshWave; +} - fluxRequired - { - default yes; - p ; - } +fluxRequired +{ + default yes; + p ; +} diff --git a/elastic-tube-3d/fluid-openfoam/system/fvSolution b/elastic-tube-3d/fluid-openfoam/system/fvSolution index 48444e2b6..40c25c2b6 100755 --- a/elastic-tube-3d/fluid-openfoam/system/fvSolution +++ b/elastic-tube-3d/fluid-openfoam/system/fvSolution @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location system; object fvSolution; } @@ -200,8 +199,9 @@ residualControl */ // OpenFOAM 6 (.org) or newer +// see also https://bugs.openfoam.org/view.php?id=3336 /* -residualControl +outerResidualControl { U 0.0001; p 0.0001; diff --git a/elastic-tube-3d/fluid-openfoam/system/preciceDict b/elastic-tube-3d/fluid-openfoam/system/preciceDict index 152688f59..9a2163a66 100644 --- a/elastic-tube-3d/fluid-openfoam/system/preciceDict +++ b/elastic-tube-3d/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/elastic-tube-3d/fluid-openfoam/time-series b/elastic-tube-3d/fluid-openfoam/time-series index 004c64129..50bfca4a9 100644 --- a/elastic-tube-3d/fluid-openfoam/time-series +++ b/elastic-tube-3d/fluid-openfoam/time-series @@ -1,6 +1,6 @@ ( -(0 1.3332) -(3e-3 1.3332) -(3.1e-3 0) -(1e-2 0) + (0 1.3332) + (3e-3 1.3332) + (3.1e-3 0) + (1e-2 0) ) diff --git a/elastic-tube-3d/images/tutorials-elastic-tube-3d-plot.png b/elastic-tube-3d/images/tutorials-elastic-tube-3d-plot.png new file mode 100644 index 000000000..3eae44a0f Binary files /dev/null and b/elastic-tube-3d/images/tutorials-elastic-tube-3d-plot.png differ diff --git a/elastic-tube-3d/plot-all-displacements.sh b/elastic-tube-3d/plot-all-displacements.sh new file mode 100755 index 000000000..128f7ca03 --- /dev/null +++ b/elastic-tube-3d/plot-all-displacements.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +gnuplot -p << EOF + set grid + set title 'displacement at the middle of the tube + set xlabel 'time [s]' + set ylabel 'displacement [m]' + set term pngcairo enhanced size 900,654 + set output "images/tutorials-elastic-tube-3d-displacement-all-watchpoints.png" + plot "solid-calculix/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:5 with lines title "OpenFOAM-CalculiX circumferential", \ + "solid-calculix/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:6 with lines title "OpenFOAM-CalculiX radial", \ + "solid-calculix/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:7 with lines title "OpenFOAM-CalculiX axial", \ + "solid-fenics/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:5 with lines title "OpenFOAM-FEniCS circumferential", \ + "solid-fenics/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:6 with lines title "OpenFOAM-FEniCS radial", \ + "solid-fenics/precice-Solid-watchpoint-Tube-Midpoint.log" using 1:7 with lines title "OpenFOAM-FEniCS axial +EOF diff --git a/elastic-tube-3d/precice-config.xml b/elastic-tube-3d/precice-config.xml index b57775c4d..ff3ee9296 100644 --- a/elastic-tube-3d/precice-config.xml +++ b/elastic-tube-3d/precice-config.xml @@ -19,13 +19,13 @@ - + - + @@ -33,37 +33,38 @@ - - + + - - + + + - + - + - - + + - - + + - + diff --git a/elastic-tube-3d/solid-calculix/config.yml b/elastic-tube-3d/solid-calculix/config.yml index 43c524a66..b567612be 100644 --- a/elastic-tube-3d/solid-calculix/config.yml +++ b/elastic-tube-3d/solid-calculix/config.yml @@ -1,7 +1,7 @@ participants: - Calculix: + Solid: interfaces: - - nodes-mesh-with-connectivity: Calculix_Mesh + - nodes-mesh-with-connectivity: Solid-Mesh patch: interface read-data: [Force] write-data: [DisplacementDelta] diff --git a/elastic-tube-3d/solid-calculix/run.sh b/elastic-tube-3d/solid-calculix/run.sh index 5f1ff6813..5ebdaf5b2 100755 --- a/elastic-tube-3d/solid-calculix/run.sh +++ b/elastic-tube-3d/solid-calculix/run.sh @@ -3,4 +3,4 @@ set -e -u export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -ccx_preCICE -i tube -precice-participant Calculix +ccx_preCICE -i tube -precice-participant Solid diff --git a/elastic-tube-3d/solid-fenics/clean.sh b/elastic-tube-3d/solid-fenics/clean.sh new file mode 100755 index 000000000..3a8b4619d --- /dev/null +++ b/elastic-tube-3d/solid-fenics/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_fenics . diff --git a/elastic-tube-3d/solid-fenics/precice-adapter-config-fsi-s.json b/elastic-tube-3d/solid-fenics/precice-adapter-config-fsi-s.json new file mode 100644 index 000000000..9acb11985 --- /dev/null +++ b/elastic-tube-3d/solid-fenics/precice-adapter-config-fsi-s.json @@ -0,0 +1,9 @@ +{ + "participant_name": "Solid", + "config_file_name": "../precice-config.xml", + "interface": { + "coupling_mesh_name": "Solid-Mesh", + "write_data_name": "DisplacementDelta", + "read_data_name": "Force" + } +} diff --git a/elastic-tube-3d/solid-fenics/run.sh b/elastic-tube-3d/solid-fenics/run.sh new file mode 100755 index 000000000..15315c67d --- /dev/null +++ b/elastic-tube-3d/solid-fenics/run.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e -u + +python3 solid.py diff --git a/elastic-tube-3d/solid-fenics/solid.py b/elastic-tube-3d/solid-fenics/solid.py new file mode 100644 index 000000000..3fed84945 --- /dev/null +++ b/elastic-tube-3d/solid-fenics/solid.py @@ -0,0 +1,226 @@ +# Import required libs +from fenics import Constant, Function, AutoSubDomain, VectorFunctionSpace, interpolate, \ + TrialFunction, TestFunction, Point, Expression, DirichletBC, nabla_grad, \ + Identity, inner, dx, ds, sym, grad, lhs, rhs, dot, File, solve, assemble_system +from mshr import Cylinder, generate_mesh +from ufl import nabla_div +import numpy as np +from fenicsprecice import Adapter +import math + + +# define the two kinds of boundary: clamped and coupling Neumann Boundary +def clamped_boundary(x, on_boundary): + """ + Filter nodes at both ends of tube as they are fixed + """ + tol = 1E-14 + return on_boundary and (((abs(x[2]) - 0.0) < tol) or ((L - abs(x[2])) < tol)) + + +def neumann_boundary(x, on_boundary): + """ + Filter nodes which lie on the inner surface of the tube and excluding end nodes + """ + tol = 1E-14 + return on_boundary and ((math.sqrt(x[0]**2 + x[1]**2) - R) < tol) and ((L - x[2]) > tol) and ((x[2] - 0.0) > tol) + + +# Geometry and material properties +dim = 3 # number of dimensions +R = 0.005 +L = 0.05 +rho = 3000 +E = 4000000 +nu = 0.3 + +mu = Constant(E / (2.0 * (1.0 + nu))) + +lambda_ = Constant(E * nu / ((1.0 + nu) * (1.0 - 2.0 * nu))) + +# create Mesh +outer_tube = Cylinder(Point(0, 0, L), Point(0, 0, 0), R + 0.001, R + 0.001) +inner_tube = Cylinder(Point(0, 0, L), Point(0, 0, 0), R, R) +mesh = generate_mesh(outer_tube - inner_tube, 20) + +# create Function Space +V = VectorFunctionSpace(mesh, 'P', 2) + +# Trial and Test Functions +du = TrialFunction(V) +v = TestFunction(V) + +u_np1 = Function(V) +saved_u_old = Function(V) +u_delta = Function(V) + +# function known from previous timestep +u_n = Function(V) +v_n = Function(V) +a_n = Function(V) + +coupling_boundary = AutoSubDomain(neumann_boundary) +fixed_boundary = AutoSubDomain(clamped_boundary) + +precice = Adapter(adapter_config_filename="precice-adapter-config-fsi-s.json") + +# Initialize the coupling interface +precice_dt = precice.initialize(coupling_boundary, read_function_space=V, write_object=V, fixed_boundary=fixed_boundary) + +fenics_dt = precice_dt # if fenics_dt == precice_dt, no subcycling is applied +dt = Constant(np.min([precice_dt, fenics_dt])) + +# clamp the tube on both sides +bc = DirichletBC(V, Constant((0, 0, 0)), fixed_boundary) + +# alpha method parameters +alpha_m = Constant(0) +alpha_f = Constant(0) +gamma = Constant(0.5 + alpha_f - alpha_m) +beta = Constant((gamma + 0.5) ** 2 / 4.) + + +# Define strain +def epsilon(u): + return 0.5 * (nabla_grad(u) + nabla_grad(u).T) + + +# Define Stress tensor +def sigma(u): + return lambda_ * nabla_div(u) * Identity(dim) + 2 * mu * epsilon(u) + + +# Define Mass form +def m(u, v): + return rho * inner(u, v) * dx + + +# Elastic stiffness form +def k(u, v): + return inner(sigma(u), sym(grad(v))) * dx + + +# External Work +def Wext(u_): + return dot(u_, p) * ds + + +# Functions for updating system state + +# Update acceleration +def update_a(u, u_old, v_old, a_old, ufl=True): + if ufl: + dt_ = dt + beta_ = beta + else: + dt_ = float(dt) + beta_ = float(beta) + + return ((u - u_old - dt_ * v_old) / beta / dt_ ** 2 + - (1 - 2 * beta_) / 2 / beta_ * a_old) + + +# Update velocity +def update_v(a, u_old, v_old, a_old, ufl=True): + if ufl: + dt_ = dt + gamma_ = gamma + else: + dt_ = float(dt) + gamma_ = float(gamma) + + return v_old + dt_ * ((1 - gamma_) * a_old + gamma_ * a) + + +def update_fields(u, u_old, v_old, a_old): + """Update all fields at the end of a timestep.""" + + u_vec, u0_vec = u.vector(), u_old.vector() + v0_vec, a0_vec = v_old.vector(), a_old.vector() + + # call update functions + a_vec = update_a(u_vec, u0_vec, v0_vec, a0_vec, ufl=False) + v_vec = update_v(a_vec, u0_vec, v0_vec, a0_vec, ufl=False) + + # assign u->u_old + v_old.vector()[:], a_old.vector()[:] = v_vec, a_vec + u_old.vector()[:] = u.vector() + + +def avg(x_old, x_new, alpha): + return alpha * x_old + (1 - alpha) * x_new + + +a_np1 = update_a(du, u_n, v_n, a_n, ufl=True) +v_np1 = update_v(a_np1, u_n, v_n, a_n, ufl=True) + +res = m(avg(a_n, a_np1, alpha_m), v) + k(avg(u_n, du, alpha_f), v) + +a_form = lhs(res) +L_form = rhs(res) + +# parameters for Time-Stepping +t = 0.0 +n = 0 +E_ext = 0 + +displacement_out = File("output/u_fsi.pvd") + +u_n.rename("Displacement", "") +u_np1.rename("Displacement", "") +displacement_out << u_n + +while precice.is_coupling_ongoing(): + + if precice.is_action_required(precice.action_write_iteration_checkpoint()): # write checkpoint + precice.store_checkpoint(u_n, t, n) + + # read data from preCICE and get a new coupling expression + read_data = precice.read_data() + + # Update the point sources on the coupling boundary with the new read data + forces_x, forces_y, forces_z = precice.get_point_sources(read_data) + + A, b = assemble_system(a_form, L_form, bc) + + b_forces = b.copy() # b is the same for every iteration, only forces change + + for ps in forces_x: + ps.apply(b_forces) + for ps in forces_y: + ps.apply(b_forces) + for ps in forces_z: + ps.apply(b_forces) + + assert (b is not b_forces) + solve(A, u_np1.vector(), b_forces) + + dt = Constant(np.min([precice_dt, fenics_dt])) + + # Write relative displacements to preCICE + u_delta.vector()[:] = u_np1.vector()[:] - u_n.vector()[:] + precice.write_data(u_delta) + + # Call to advance coupling, also returns the optimum time step value + precice_dt = precice.advance(dt(0)) + + # Either revert to old step if timestep has not converged or move to next timestep + if precice.is_action_required(precice.action_read_iteration_checkpoint()): # roll back to checkpoint + u_cp, t_cp, n_cp = precice.retrieve_checkpoint() + u_n.assign(u_cp) + t = t_cp + n = n_cp + else: + u_n.assign(u_np1) + t += float(dt) + n += 1 + + if precice.is_time_window_complete(): + update_fields(u_np1, saved_u_old, v_n, a_n) + if n % 10 == 0: + displacement_out << (u_n, t) + +# Plot tip displacement evolution +displacement_out << u_n + +precice.finalize() diff --git a/flow-over-heated-plate-nearest-projection/README.md b/flow-over-heated-plate-nearest-projection/README.md index 2682f7fc6..209e9d447 100644 --- a/flow-over-heated-plate-nearest-projection/README.md +++ b/flow-over-heated-plate-nearest-projection/README.md @@ -41,7 +41,7 @@ cd solid-openfoam ./run.sh ``` -You can also run OpenFOAM in parallel by `./run.sh -parallel`. If you are using OpenFOAM v1712 / 5.x or older have a look in the `fluid-openfoam/system/controlDict` file and set the appropriate solver name. +You can also run OpenFOAM in parallel by `./run.sh -parallel`. ## Changes in the Simulation Setup diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/T b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/T index fad9ded3e..abf1bce54 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/T +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/T @@ -5,7 +5,6 @@ FoamFile class volScalarField; object T; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 0 0 1 0 0 0 ]; @@ -48,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/U b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/U index 2d9ee8fcb..cfe775cf3 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/U +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/U @@ -5,7 +5,6 @@ FoamFile class volVectorField; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 1 -1 0 0 0 0 ]; @@ -43,6 +42,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/alphat b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/alphat index 658075c8a..1d3ac72d0 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/alphat +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/alphat @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object alphat; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -1 0 0 0 0 ]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/epsilon b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/epsilon index 763f85ba3..c419576fc 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/epsilon +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/epsilon @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object epsilon; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -3 0 0 0 0 ]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/k b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/k index 3fcebfa3c..a09c9617c 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/k +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/k @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object k; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -2 0 0 0 0 ]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/nut b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/nut index 72e6ef35a..580e908d7 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/nut +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/nut @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object nut; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -1 0 0 0 0 ]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p index 6eb21cecf..654bb4023 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -2 0 0 0 0 ]; @@ -53,6 +52,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p_rgh b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p_rgh index 31673b434..c5eebe883 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p_rgh +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/0/p_rgh @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p_rgh; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -2 0 0 0 0 ]; @@ -43,6 +42,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/g b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/g index 9d33548db..ca544e1f1 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/g +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/g @@ -3,13 +3,8 @@ FoamFile version 2.0; format ascii; class uniformDimensionedVectorField; - location "constant"; object g; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 -9.81 0); - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/thermophysicalProperties b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/thermophysicalProperties index 9992c3670..50413edcb 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/thermophysicalProperties +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/thermophysicalProperties @@ -3,27 +3,24 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object thermophysicalProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType { - type heRhoThermo; - mixture pureMixture; - transport const; - thermo hConst; - equationOfState perfectGas; - specie specie; - energy sensibleEnthalpy; + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; } mixture { specie { - nMoles 1; molWeight 24.0999; } thermodynamics @@ -37,6 +34,3 @@ mixture Pr 0.01; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/turbulenceProperties b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/turbulenceProperties index a5ca2ead4..8271e5f76 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/turbulenceProperties +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/constant/turbulenceProperties @@ -6,14 +6,5 @@ FoamFile location "constant"; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; - -RAS -{ - RASModel kEpsilon; - turbulence off; -} - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/blockMeshDict b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/blockMeshDict index de9322736..20c24a506 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/blockMeshDict +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/blockMeshDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; @@ -42,10 +41,6 @@ blocks hex (1 8 9 2 5 10 11 6) (51 41 1) simpleGrading (1 15 1) ); -edges -( -); - boundary ( @@ -106,9 +101,3 @@ boundary } ); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/controlDict b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/controlDict index 1f4d27106..edf69a529 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/controlDict +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/controlDict @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application buoyantPimpleFoam; @@ -46,7 +44,3 @@ functions libs ("libpreciceAdapterFunctionObject.so"); } } - - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/decomposeParDict b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/decomposeParDict index ad99cf6c5..979d08fad 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/decomposeParDict +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/decomposeParDict @@ -5,9 +5,9 @@ FoamFile { format ascii; } -numberOfSubdomains 2; +numberOfSubdomains 2; -method simple; +method simple; simpleCoeffs { diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSchemes b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSchemes index 16fe50adc..937165c3a 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSchemes +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSchemes @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { @@ -47,6 +45,3 @@ snGradSchemes { default corrected; } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSolution b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSolution index ea2b78f4c..d9a4f1673 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSolution +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -54,6 +52,3 @@ PIMPLE nCorrectors 2; nNonOrthogonalCorrectors 0; } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/preciceDict b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/preciceDict index 57df62850..11b4f38d0 100644 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/preciceDict +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/T b/flow-over-heated-plate-steady-state/fluid-openfoam/0/T index 38e3e14b1..70a7cfde7 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/T +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/T @@ -5,7 +5,6 @@ FoamFile class volScalarField; object T; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; @@ -64,5 +63,3 @@ boundaryField } } - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/U b/flow-over-heated-plate-steady-state/fluid-openfoam/0/U index d29b5ea55..86a2c7400 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/U +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/U @@ -5,7 +5,6 @@ FoamFile class volVectorField; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -53,5 +52,3 @@ boundaryField } } - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/alphat b/flow-over-heated-plate-steady-state/fluid-openfoam/0/alphat index 21992e643..3682f9bf0 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/alphat +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/alphat @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object alphat; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; @@ -50,6 +48,3 @@ boundaryField } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/epsilon b/flow-over-heated-plate-steady-state/fluid-openfoam/0/epsilon index 732df6c14..8102db9d6 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/epsilon +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/epsilon @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object epsilon; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/k b/flow-over-heated-plate-steady-state/fluid-openfoam/0/k index 820daaa92..91066d443 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/k +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/k @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object k; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -49,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/nut b/flow-over-heated-plate-steady-state/fluid-openfoam/0/nut index 7d9945f0c..e9a4c10e5 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/nut +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/nut @@ -4,10 +4,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; object nut; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; @@ -50,6 +48,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/p b/flow-over-heated-plate-steady-state/fluid-openfoam/0/p index 5e8193004..06072f75d 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/p +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -63,5 +62,3 @@ boundaryField } } - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/0/p_rgh b/flow-over-heated-plate-steady-state/fluid-openfoam/0/p_rgh index 8e5217d1d..63b464f53 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/0/p_rgh +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/0/p_rgh @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p_rgh; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -48,5 +47,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/g b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/g index 64e6a8788..1d992f742 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/g +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/g @@ -3,13 +3,8 @@ FoamFile version 2.0; format ascii; class uniformDimensionedVectorField; - location "constant"; object g; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value ( 0 0 0 ); - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/thermophysicalProperties b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/thermophysicalProperties index 171ca1957..a901c8aef 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/thermophysicalProperties +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/thermophysicalProperties @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object thermophysicalProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dpdt no; @@ -25,7 +23,6 @@ mixture { specie { - nMoles 1; molWeight 24.09989; } thermodynamics @@ -39,6 +36,3 @@ mixture Pr 0.01; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/turbulenceProperties b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/turbulenceProperties index 43760b90f..b75c49530 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/constant/turbulenceProperties +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/constant/turbulenceProperties @@ -3,18 +3,7 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; - -RAS -{ - RASModel kEpsilon; - turbulence off; - printCoeffs on; -} - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/system/blockMeshDict b/flow-over-heated-plate-steady-state/fluid-openfoam/system/blockMeshDict index 94b912f9a..0c5118983 100755 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/system/blockMeshDict +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/system/blockMeshDict @@ -5,9 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - convertToMeters 1; @@ -45,10 +42,6 @@ blocks hex (1 8 9 2 5 10 11 6) (51 41 4) simpleGrading (1 15 1) ); -edges -( -); - boundary ( @@ -109,9 +102,3 @@ boundary } ); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/system/controlDict b/flow-over-heated-plate-steady-state/fluid-openfoam/system/controlDict index 9e8689acc..db751afa7 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/system/controlDict +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/system/controlDict @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application buoyantSimpleFoam; @@ -44,7 +42,3 @@ functions libs ("libpreciceAdapterFunctionObject.so"); } } - - - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSchemes b/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSchemes index 07934a877..d471fedf6 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSchemes +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSchemes @@ -4,51 +4,58 @@ FoamFile { object fvSchemes; format ascii; } + ddtSchemes { default steadyState; } + gradSchemes { - grad(e) cellLimited Gauss linear 1.0; - default cellLimited Gauss linear 1.0; - grad(p_rgh) cellLimited Gauss linear 1.0; - grad(U) cellLimited Gauss linear 1.0; - grad(h) cellLimited Gauss linear 1.0; - grad(rho) cellLimited Gauss linear 1.0; -} + default cellLimited Gauss linear 1.0; + grad(e) cellLimited Gauss linear 1.0; + grad(p_rgh) cellLimited Gauss linear 1.0; + grad(U) cellLimited Gauss linear 1.0; + grad(h) cellLimited Gauss linear 1.0; + grad(rho) cellLimited Gauss linear 1.0; +} + divSchemes { - div(phi,e) bounded Gauss upwind; - div(phi,h) bounded Gauss upwind; - default Gauss linear; + default Gauss linear; + div(phi,e) bounded Gauss upwind; + div(phi,h) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; - div(phiv,p) bounded Gauss upwind; - div(phi,K) bounded Gauss upwind; - div(phi,U) bounded Gauss upwind; + div(phiv,p) bounded Gauss upwind; + div(phi,K) bounded Gauss upwind; + div(phi,U) bounded Gauss upwind; } + laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(rhorAUf,p_rgh) Gauss linear corrected; - default Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; - laplacian(alpha,h) Gauss linear corrected; -} + default Gauss linear corrected; + laplacian(muEff,U) Gauss linear corrected; + laplacian(rhorAUf,p_rgh) Gauss linear corrected; + laplacian(alphaEff,e) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; + laplacian(alpha,h) Gauss linear corrected; +} + interpolationSchemes { - interpolate(grad(h)) linear; - default linear; + default linear; + interpolate(grad(h)) linear; interpolate((thermo:rho*Cp)) linear; - interpolate((rho*rAU)) linear; - interpolate(rho) linear; - interpolate(kappa) linear; - interpolate(mag(Kappa)) linear; - interpolate((rho*HbyA)) linear; - interpolate((rho_0*U_0)) linear; -} + interpolate((rho*rAU)) linear; + interpolate(rho) linear; + interpolate(kappa) linear; + interpolate(mag(Kappa)) linear; + interpolate((rho*HbyA)) linear; + interpolate((rho_0*U_0)) linear; +} + snGradSchemes { - default corrected; - snGrad(rho) corrected; - snGrad(p_rgh) corrected; + default corrected; + snGrad(rho) corrected; + snGrad(p_rgh) corrected; } + fluxRequired { default no; - p_rgh ; + p_rgh; } diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSolution b/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSolution index 29e027ef8..34246cd4f 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSolution +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -87,5 +85,3 @@ relaxationFactors h 0.99; } } - -// ************************************************************************* // diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/system/preciceDict b/flow-over-heated-plate-steady-state/fluid-openfoam/system/preciceDict index 932e42bdd..6eda33e26 100644 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/system/preciceDict +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/flow-over-heated-plate-steady-state/solid-codeaster/run.sh b/flow-over-heated-plate-steady-state/solid-codeaster/run.sh index 3860a6a10..0af4b021f 100755 --- a/flow-over-heated-plate-steady-state/solid-codeaster/run.sh +++ b/flow-over-heated-plate-steady-state/solid-codeaster/run.sh @@ -4,9 +4,9 @@ set -e -u echo "Warning: this case requires a manual preparation step for code_aster." echo "You also need to set an absolute path as exchange-directory in precice-config.xml." echo "See the tutorial and code_aster adapter documentation pages for more:" -echo "https://www.precice.org/adapter-code_aster.html" +echo "https://precice.org/adapter-code_aster.html" echo "" -export TUTORIAL_ROOT=${PWD} +export TUTORIAL_ROOT="${PWD}" export PRECICE_PARTICIPANT=Solid as_run --run solid.export diff --git a/flow-over-heated-plate/fluid-openfoam/0/T b/flow-over-heated-plate/fluid-openfoam/0/T index ed002e908..abf1bce54 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/T +++ b/flow-over-heated-plate/fluid-openfoam/0/T @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -12,7 +5,6 @@ FoamFile class volScalarField; object T; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 0 0 1 0 0 0 ]; @@ -55,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/U b/flow-over-heated-plate/fluid-openfoam/0/U index 3cc2f65ee..cfe775cf3 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/U +++ b/flow-over-heated-plate/fluid-openfoam/0/U @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -12,7 +5,6 @@ FoamFile class volVectorField; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 1 -1 0 0 0 0 ]; @@ -50,6 +42,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/alphat b/flow-over-heated-plate/fluid-openfoam/0/alphat index 8cdbda4b4..1d3ac72d0 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/alphat +++ b/flow-over-heated-plate/fluid-openfoam/0/alphat @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object alphat; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -1 0 0 0 0 ]; @@ -56,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/epsilon b/flow-over-heated-plate/fluid-openfoam/0/epsilon index a1374d174..c419576fc 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/epsilon +++ b/flow-over-heated-plate/fluid-openfoam/0/epsilon @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object epsilon; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -3 0 0 0 0 ]; @@ -56,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/k b/flow-over-heated-plate/fluid-openfoam/0/k index 87a6a0a83..a09c9617c 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/k +++ b/flow-over-heated-plate/fluid-openfoam/0/k @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object k; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -2 0 0 0 0 ]; @@ -56,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/nut b/flow-over-heated-plate/fluid-openfoam/0/nut index 9cb00d410..580e908d7 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/nut +++ b/flow-over-heated-plate/fluid-openfoam/0/nut @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object nut; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 2 -1 0 0 0 0 ]; @@ -56,6 +47,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/p b/flow-over-heated-plate/fluid-openfoam/0/p index 33c185074..654bb4023 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/p +++ b/flow-over-heated-plate/fluid-openfoam/0/p @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -12,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -2 0 0 0 0 ]; @@ -60,6 +52,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/0/p_rgh b/flow-over-heated-plate/fluid-openfoam/0/p_rgh index 6829b2c16..c5eebe883 100644 --- a/flow-over-heated-plate/fluid-openfoam/0/p_rgh +++ b/flow-over-heated-plate/fluid-openfoam/0/p_rgh @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -12,7 +5,6 @@ FoamFile class volScalarField; object p_rgh; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 1 -1 -2 0 0 0 0 ]; @@ -50,6 +42,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/constant/g b/flow-over-heated-plate/fluid-openfoam/constant/g index 66a77f74e..ca544e1f1 100644 --- a/flow-over-heated-plate/fluid-openfoam/constant/g +++ b/flow-over-heated-plate/fluid-openfoam/constant/g @@ -1,22 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; - location "constant"; object g; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 -9.81 0); - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/constant/thermophysicalProperties b/flow-over-heated-plate/fluid-openfoam/constant/thermophysicalProperties index e47cdd82e..7b93ee2ea 100644 --- a/flow-over-heated-plate/fluid-openfoam/constant/thermophysicalProperties +++ b/flow-over-heated-plate/fluid-openfoam/constant/thermophysicalProperties @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -13,7 +6,6 @@ FoamFile location "constant"; object thermophysicalProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType { @@ -30,7 +22,6 @@ mixture { specie { - nMoles 1; molWeight 24.0999; } thermodynamics @@ -44,6 +35,3 @@ mixture Pr 0.01; } } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/constant/turbulenceProperties b/flow-over-heated-plate/fluid-openfoam/constant/turbulenceProperties index 95da7141e..b75c49530 100644 --- a/flow-over-heated-plate/fluid-openfoam/constant/turbulenceProperties +++ b/flow-over-heated-plate/fluid-openfoam/constant/turbulenceProperties @@ -1,26 +1,9 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; - -RAS -{ - RASModel kEpsilon; - turbulence off; -} - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/system/blockMeshDict b/flow-over-heated-plate/fluid-openfoam/system/blockMeshDict index 55281d6a5..de95b0ace 100644 --- a/flow-over-heated-plate/fluid-openfoam/system/blockMeshDict +++ b/flow-over-heated-plate/fluid-openfoam/system/blockMeshDict @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -12,8 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - vertices ( @@ -48,10 +39,6 @@ blocks hex (1 8 9 2 5 10 11 6) (51 41 1) simpleGrading (1 15 1) ); -edges -( -); - boundary ( @@ -112,9 +99,3 @@ boundary } ); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/system/controlDict b/flow-over-heated-plate/fluid-openfoam/system/controlDict index bdfdb5da9..edf69a529 100644 --- a/flow-over-heated-plate/fluid-openfoam/system/controlDict +++ b/flow-over-heated-plate/fluid-openfoam/system/controlDict @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application buoyantPimpleFoam; @@ -53,7 +44,3 @@ functions libs ("libpreciceAdapterFunctionObject.so"); } } - - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/system/decomposeParDict b/flow-over-heated-plate/fluid-openfoam/system/decomposeParDict index ad99cf6c5..0d1859e14 100644 --- a/flow-over-heated-plate/fluid-openfoam/system/decomposeParDict +++ b/flow-over-heated-plate/fluid-openfoam/system/decomposeParDict @@ -11,6 +11,6 @@ method simple; simpleCoeffs { - n (2 1 1); - delta 0.001; + n (2 1 1); + delta 0.001; } diff --git a/flow-over-heated-plate/fluid-openfoam/system/fvSchemes b/flow-over-heated-plate/fluid-openfoam/system/fvSchemes index 3eb3688c2..fd48cb5b7 100644 --- a/flow-over-heated-plate/fluid-openfoam/system/fvSchemes +++ b/flow-over-heated-plate/fluid-openfoam/system/fvSchemes @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -13,7 +6,6 @@ FoamFile location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { @@ -54,6 +46,3 @@ snGradSchemes { default corrected; } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/fluid-openfoam/system/fvSolution b/flow-over-heated-plate/fluid-openfoam/system/fvSolution index e55987f34..e7047fa96 100644 --- a/flow-over-heated-plate/fluid-openfoam/system/fvSolution +++ b/flow-over-heated-plate/fluid-openfoam/system/fvSolution @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -13,7 +6,6 @@ FoamFile location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -61,6 +53,3 @@ PIMPLE nCorrectors 2; nNonOrthogonalCorrectors 0; } - - -// ************************************************************************* // diff --git a/flow-over-heated-plate/solid-fenics/solid.py b/flow-over-heated-plate/solid-fenics/solid.py index 105ea30a9..23ee3bbd4 100644 --- a/flow-over-heated-plate/solid-fenics/solid.py +++ b/flow-over-heated-plate/solid-fenics/solid.py @@ -141,14 +141,14 @@ def determine_heat_flux(V_g, u, k, flux): u_D.t = t + dt # mark mesh w.r.t ranks -ranks = File("Solid/VTK/ranks%s.pvd.pvd" % precice.get_participant_name()) +ranks = File("output/ranks%s.pvd.pvd" % precice.get_participant_name()) mesh_rank = MeshFunction("size_t", mesh, mesh.topology().dim()) mesh_rank.set_all(MPI.rank(MPI.comm_world)) mesh_rank.rename("myRank", "") ranks << mesh_rank # Create output file -file_out = File("Solid/VTK/%s.pvd" % precice.get_participant_name()) +file_out = File("output/%s.pvd" % precice.get_participant_name()) file_out << u_n print("output vtk for time = {}".format(float(t))) diff --git a/heat-exchanger/fluid-inner-openfoam/0/T b/heat-exchanger/fluid-inner-openfoam/0/T index 1bdc6ec75..fde10f98f 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/T +++ b/heat-exchanger/fluid-inner-openfoam/0/T @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_2"; object T; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; @@ -42,6 +33,3 @@ boundaryField type zeroGradient; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/U b/heat-exchanger/fluid-inner-openfoam/0/U index 09cc8ce79..3bd740d94 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/U +++ b/heat-exchanger/fluid-inner-openfoam/0/U @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; - location "0/Zone_solid_2"; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -41,6 +32,3 @@ boundaryField value uniform (0 0 0); } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/alphat b/heat-exchanger/fluid-inner-openfoam/0/alphat index 24d11a2f2..03047af9a 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/alphat +++ b/heat-exchanger/fluid-inner-openfoam/0/alphat @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object alphat; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/epsilon b/heat-exchanger/fluid-inner-openfoam/0/epsilon index 0dcd39da8..351c4a840 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/epsilon +++ b/heat-exchanger/fluid-inner-openfoam/0/epsilon @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object epsilon; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 1e-6; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/k b/heat-exchanger/fluid-inner-openfoam/0/k index 4aa87181e..256131bba 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/k +++ b/heat-exchanger/fluid-inner-openfoam/0/k @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object k; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/nut b/heat-exchanger/fluid-inner-openfoam/0/nut index 88c6fc85c..541c6425e 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/nut +++ b/heat-exchanger/fluid-inner-openfoam/0/nut @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object nut; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/p b/heat-exchanger/fluid-inner-openfoam/0/p index 2a9ce1844..37d628dbd 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/p +++ b/heat-exchanger/fluid-inner-openfoam/0/p @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_2"; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -42,6 +33,3 @@ boundaryField value uniform 101325; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/0/p_rgh b/heat-exchanger/fluid-inner-openfoam/0/p_rgh index 7b6ab90dc..30da491ca 100644 --- a/heat-exchanger/fluid-inner-openfoam/0/p_rgh +++ b/heat-exchanger/fluid-inner-openfoam/0/p_rgh @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_2"; object p_rgh; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -43,6 +34,3 @@ boundaryField value uniform 101325; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-inner-openfoam/constant/g b/heat-exchanger/fluid-inner-openfoam/constant/g index 3d548e617..03bf70885 100644 --- a/heat-exchanger/fluid-inner-openfoam/constant/g +++ b/heat-exchanger/fluid-inner-openfoam/constant/g @@ -1,8 +1,12 @@ -FoamFile { - version 2.0; - class uniformDimensionedVectorField; - object g; - format ascii; +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; } -value (0.0 0.0 0.0); + dimensions [0 1 -2 0 0 0 0]; + +value (0.0 0.0 0.0); + diff --git a/heat-exchanger/fluid-inner-openfoam/constant/radiationProperties b/heat-exchanger/fluid-inner-openfoam/constant/radiationProperties deleted file mode 100644 index 7f6c4885b..000000000 --- a/heat-exchanger/fluid-inner-openfoam/constant/radiationProperties +++ /dev/null @@ -1,8 +0,0 @@ -FoamFile { - version 2.0; - class dictionary; - object radiationProperties; - format ascii; -} -radiation off; -radiationModel none; diff --git a/heat-exchanger/fluid-inner-openfoam/constant/thermophysicalProperties b/heat-exchanger/fluid-inner-openfoam/constant/thermophysicalProperties index a34ad1449..bb2648261 100644 --- a/heat-exchanger/fluid-inner-openfoam/constant/thermophysicalProperties +++ b/heat-exchanger/fluid-inner-openfoam/constant/thermophysicalProperties @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; - location "constant"; - object thermophysicalProperties.water; + object thermophysicalProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dpdt no; @@ -51,4 +42,3 @@ mixture Pr 2.289; } } - diff --git a/heat-exchanger/fluid-inner-openfoam/constant/turbulenceProperties b/heat-exchanger/fluid-inner-openfoam/constant/turbulenceProperties index 4e34e7806..2b2c4a310 100644 --- a/heat-exchanger/fluid-inner-openfoam/constant/turbulenceProperties +++ b/heat-exchanger/fluid-inner-openfoam/constant/turbulenceProperties @@ -1,14 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object turbulenceProperties; - format ascii; + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; } -simulationType laminar; -RAS -{ - RASModel kEpsilon; - turbulence off; - printCoeffs on; -} +simulationType laminar; diff --git a/heat-exchanger/fluid-inner-openfoam/system/controlDict b/heat-exchanger/fluid-inner-openfoam/system/controlDict index fde22f262..8b2c0d38d 100644 --- a/heat-exchanger/fluid-inner-openfoam/system/controlDict +++ b/heat-exchanger/fluid-inner-openfoam/system/controlDict @@ -1,24 +1,39 @@ FoamFile { - version 2.0; - class dictionary; - object controlDict; - format ascii; + version 2.0; + format ascii; + class dictionary; + object controlDict; } -application buoyantSimpleFoam; -startFrom startTime; -stopAt endTime; -writeFormat ascii; -writePrecision 12; -writeCompression on; -timeFormat general; -timePrecision 12; -runTimeModifiable false; -deltaT 1; -startTime 0.0; -writeInterval 50; -adjustTimeStep no; -endTime 2000.0; -writeControl timeStep; + +application buoyantSimpleFoam; + +startFrom startTime; + +stopAt endTime; + +writeFormat ascii; + +writePrecision 12; + +writeCompression on; + +timeFormat general; + +timePrecision 12; + +runTimeModifiable false; + +deltaT 1; + +startTime 0.0; + +writeInterval 50; + +adjustTimeStep no; + +endTime 2000.0; + +writeControl timeStep; functions { diff --git a/heat-exchanger/fluid-inner-openfoam/system/decomposeParDict b/heat-exchanger/fluid-inner-openfoam/system/decomposeParDict index f22d98557..672e38ef1 100755 --- a/heat-exchanger/fluid-inner-openfoam/system/decomposeParDict +++ b/heat-exchanger/fluid-inner-openfoam/system/decomposeParDict @@ -1,8 +1,10 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; } + method scotch; + numberOfSubdomains 2; diff --git a/heat-exchanger/fluid-inner-openfoam/system/fvOptions b/heat-exchanger/fluid-inner-openfoam/system/fvOptions index da779a0c2..e61c9ace7 100644 --- a/heat-exchanger/fluid-inner-openfoam/system/fvOptions +++ b/heat-exchanger/fluid-inner-openfoam/system/fvOptions @@ -1,6 +1,6 @@ FoamFile { - version 2.0; - class dictionary; - object fvOptions; - format ascii; + version 2.0; + class dictionary; + object fvOptions; + format ascii; } diff --git a/heat-exchanger/fluid-inner-openfoam/system/fvSchemes b/heat-exchanger/fluid-inner-openfoam/system/fvSchemes index 07934a877..52bf9cc35 100644 --- a/heat-exchanger/fluid-inner-openfoam/system/fvSchemes +++ b/heat-exchanger/fluid-inner-openfoam/system/fvSchemes @@ -1,54 +1,41 @@ FoamFile { - version 2.0; - class dictionary; - object fvSchemes; - format ascii; + version 2.0; + format ascii; + class dictionary; + object fvSchemes; } + ddtSchemes { default steadyState; } + gradSchemes { - grad(e) cellLimited Gauss linear 1.0; - default cellLimited Gauss linear 1.0; - grad(p_rgh) cellLimited Gauss linear 1.0; - grad(U) cellLimited Gauss linear 1.0; - grad(h) cellLimited Gauss linear 1.0; - grad(rho) cellLimited Gauss linear 1.0; + default cellLimited Gauss linear 1.0; } + divSchemes { - div(phi,e) bounded Gauss upwind; - div(phi,h) bounded Gauss upwind; - default Gauss linear; + default Gauss linear; + div(phi,e) bounded Gauss upwind; + div(phi,h) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; - div(phiv,p) bounded Gauss upwind; - div(phi,K) bounded Gauss upwind; - div(phi,U) bounded Gauss upwind; + div(phiv,p) bounded Gauss upwind; + div(phi,K) bounded Gauss upwind; + div(phi,U) bounded Gauss upwind; } + laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(rhorAUf,p_rgh) Gauss linear corrected; - default Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; - laplacian(alpha,h) Gauss linear corrected; + default Gauss linear corrected; } + interpolationSchemes { - interpolate(grad(h)) linear; - default linear; - interpolate((thermo:rho*Cp)) linear; - interpolate((rho*rAU)) linear; - interpolate(rho) linear; - interpolate(kappa) linear; - interpolate(mag(Kappa)) linear; - interpolate((rho*HbyA)) linear; - interpolate((rho_0*U_0)) linear; + default linear; } + snGradSchemes { - default corrected; - snGrad(rho) corrected; - snGrad(p_rgh) corrected; + default corrected; } + fluxRequired { default no; - p_rgh ; + p_rgh; } diff --git a/heat-exchanger/fluid-inner-openfoam/system/fvSolution b/heat-exchanger/fluid-inner-openfoam/system/fvSolution index 06a34475d..2cb8ffaa2 100644 --- a/heat-exchanger/fluid-inner-openfoam/system/fvSolution +++ b/heat-exchanger/fluid-inner-openfoam/system/fvSolution @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -88,5 +79,3 @@ relaxationFactors h 0.99; } } - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/T b/heat-exchanger/fluid-outer-openfoam/0/T index 07f79e7a0..151450f45 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/T +++ b/heat-exchanger/fluid-outer-openfoam/0/T @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_1"; object T; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; @@ -42,6 +33,3 @@ boundaryField type zeroGradient; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/U b/heat-exchanger/fluid-outer-openfoam/0/U index c72388097..4d6293388 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/U +++ b/heat-exchanger/fluid-outer-openfoam/0/U @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; - location "0/Zone_solid_1"; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -41,6 +32,3 @@ boundaryField value uniform (0 0 0); } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/alphat b/heat-exchanger/fluid-outer-openfoam/0/alphat index 24d11a2f2..03047af9a 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/alphat +++ b/heat-exchanger/fluid-outer-openfoam/0/alphat @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object alphat; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/epsilon b/heat-exchanger/fluid-outer-openfoam/0/epsilon index 0dcd39da8..351c4a840 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/epsilon +++ b/heat-exchanger/fluid-outer-openfoam/0/epsilon @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object epsilon; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 1e-6; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/k b/heat-exchanger/fluid-outer-openfoam/0/k index 4aa87181e..afa8b4162 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/k +++ b/heat-exchanger/fluid-outer-openfoam/0/k @@ -1,10 +1,3 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; @@ -13,7 +6,6 @@ FoamFile location "0"; object k; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -27,6 +19,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/nut b/heat-exchanger/fluid-outer-openfoam/0/nut index 88c6fc85c..541c6425e 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/nut +++ b/heat-exchanger/fluid-outer-openfoam/0/nut @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0"; object nut; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; @@ -27,6 +18,3 @@ boundaryField value uniform 0; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/p b/heat-exchanger/fluid-outer-openfoam/0/p index b09bf799f..593ee7719 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/p +++ b/heat-exchanger/fluid-outer-openfoam/0/p @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_1"; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -42,6 +33,3 @@ boundaryField value uniform 101325; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/0/p_rgh b/heat-exchanger/fluid-outer-openfoam/0/p_rgh index 8d96cf683..9b57f2de9 100644 --- a/heat-exchanger/fluid-outer-openfoam/0/p_rgh +++ b/heat-exchanger/fluid-outer-openfoam/0/p_rgh @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; - location "0/Zone_solid_1"; object p_rgh; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; @@ -43,6 +34,3 @@ boundaryField value uniform 101325; } } - - -// ************************************************************************* // diff --git a/heat-exchanger/fluid-outer-openfoam/constant/g b/heat-exchanger/fluid-outer-openfoam/constant/g index 3d548e617..913a7a48f 100644 --- a/heat-exchanger/fluid-outer-openfoam/constant/g +++ b/heat-exchanger/fluid-outer-openfoam/constant/g @@ -1,8 +1,10 @@ FoamFile { - version 2.0; - class uniformDimensionedVectorField; - object g; - format ascii; + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; } + value (0.0 0.0 0.0); + dimensions [0 1 -2 0 0 0 0]; diff --git a/heat-exchanger/fluid-outer-openfoam/constant/radiationProperties b/heat-exchanger/fluid-outer-openfoam/constant/radiationProperties deleted file mode 100644 index 7f6c4885b..000000000 --- a/heat-exchanger/fluid-outer-openfoam/constant/radiationProperties +++ /dev/null @@ -1,8 +0,0 @@ -FoamFile { - version 2.0; - class dictionary; - object radiationProperties; - format ascii; -} -radiation off; -radiationModel none; diff --git a/heat-exchanger/fluid-outer-openfoam/constant/thermophysicalProperties b/heat-exchanger/fluid-outer-openfoam/constant/thermophysicalProperties index a34ad1449..54d56fa42 100644 --- a/heat-exchanger/fluid-outer-openfoam/constant/thermophysicalProperties +++ b/heat-exchanger/fluid-outer-openfoam/constant/thermophysicalProperties @@ -1,19 +1,11 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; - object thermophysicalProperties.water; + object thermophysicalProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dpdt no; diff --git a/heat-exchanger/fluid-outer-openfoam/constant/turbulenceProperties b/heat-exchanger/fluid-outer-openfoam/constant/turbulenceProperties index aa1011270..219383b49 100644 --- a/heat-exchanger/fluid-outer-openfoam/constant/turbulenceProperties +++ b/heat-exchanger/fluid-outer-openfoam/constant/turbulenceProperties @@ -1,15 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object turbulenceProperties; - format ascii; -} -simulationType laminar; - -RAS -{ - RASModel kEpsilon; - turbulence off; - printCoeffs on; + version 2.0; + class dictionary; + object turbulenceProperties; + format ascii; } +simulationType laminar; diff --git a/heat-exchanger/fluid-outer-openfoam/system/controlDict b/heat-exchanger/fluid-outer-openfoam/system/controlDict index fde22f262..5618652f8 100644 --- a/heat-exchanger/fluid-outer-openfoam/system/controlDict +++ b/heat-exchanger/fluid-outer-openfoam/system/controlDict @@ -1,23 +1,38 @@ FoamFile { - version 2.0; - class dictionary; - object controlDict; - format ascii; + version 2.0; + format ascii; + class dictionary; + object controlDict; } + application buoyantSimpleFoam; + startFrom startTime; + stopAt endTime; + writeFormat ascii; + writePrecision 12; + writeCompression on; + timeFormat general; + timePrecision 12; + runTimeModifiable false; + deltaT 1; + startTime 0.0; + writeInterval 50; + adjustTimeStep no; + endTime 2000.0; + writeControl timeStep; functions diff --git a/heat-exchanger/fluid-outer-openfoam/system/decomposeParDict b/heat-exchanger/fluid-outer-openfoam/system/decomposeParDict index f22d98557..63282e576 100755 --- a/heat-exchanger/fluid-outer-openfoam/system/decomposeParDict +++ b/heat-exchanger/fluid-outer-openfoam/system/decomposeParDict @@ -1,8 +1,10 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; } + method scotch; + numberOfSubdomains 2; diff --git a/heat-exchanger/fluid-outer-openfoam/system/fvOptions b/heat-exchanger/fluid-outer-openfoam/system/fvOptions index da779a0c2..951889ed0 100644 --- a/heat-exchanger/fluid-outer-openfoam/system/fvOptions +++ b/heat-exchanger/fluid-outer-openfoam/system/fvOptions @@ -1,6 +1,6 @@ FoamFile { - version 2.0; - class dictionary; - object fvOptions; - format ascii; + version 2.0; + format ascii; + class dictionary; + object fvOptions; } diff --git a/heat-exchanger/fluid-outer-openfoam/system/fvSchemes b/heat-exchanger/fluid-outer-openfoam/system/fvSchemes index 07934a877..f7418fe7d 100644 --- a/heat-exchanger/fluid-outer-openfoam/system/fvSchemes +++ b/heat-exchanger/fluid-outer-openfoam/system/fvSchemes @@ -1,54 +1,41 @@ FoamFile { - version 2.0; - class dictionary; - object fvSchemes; - format ascii; + version 2.0; + format ascii; + class dictionary; + object fvSchemes; } + ddtSchemes { - default steadyState; + default steadyState; } + gradSchemes { - grad(e) cellLimited Gauss linear 1.0; - default cellLimited Gauss linear 1.0; - grad(p_rgh) cellLimited Gauss linear 1.0; - grad(U) cellLimited Gauss linear 1.0; - grad(h) cellLimited Gauss linear 1.0; - grad(rho) cellLimited Gauss linear 1.0; + default cellLimited Gauss linear 1.0; } + divSchemes { - div(phi,e) bounded Gauss upwind; - div(phi,h) bounded Gauss upwind; - default Gauss linear; + default Gauss linear; + div(phi,e) bounded Gauss upwind; + div(phi,h) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; - div(phiv,p) bounded Gauss upwind; - div(phi,K) bounded Gauss upwind; - div(phi,U) bounded Gauss upwind; + div(phiv,p) bounded Gauss upwind; + div(phi,K) bounded Gauss upwind; + div(phi,U) bounded Gauss upwind; } + laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(rhorAUf,p_rgh) Gauss linear corrected; - default Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; - laplacian(alpha,h) Gauss linear corrected; + default Gauss linear corrected; } + interpolationSchemes { - interpolate(grad(h)) linear; - default linear; - interpolate((thermo:rho*Cp)) linear; - interpolate((rho*rAU)) linear; - interpolate(rho) linear; - interpolate(kappa) linear; - interpolate(mag(Kappa)) linear; - interpolate((rho*HbyA)) linear; - interpolate((rho_0*U_0)) linear; + default linear; } + snGradSchemes { - default corrected; - snGrad(rho) corrected; - snGrad(p_rgh) corrected; + default corrected; } + fluxRequired { - default no; - p_rgh ; + default no; + p_rgh; } diff --git a/heat-exchanger/fluid-outer-openfoam/system/fvSolution b/heat-exchanger/fluid-outer-openfoam/system/fvSolution index 06a34475d..add05cd34 100644 --- a/heat-exchanger/fluid-outer-openfoam/system/fvSolution +++ b/heat-exchanger/fluid-outer-openfoam/system/fvSolution @@ -1,19 +1,10 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 5 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -65,12 +56,9 @@ solvers { $h; relTol 0; - } - - + } } - SIMPLE { nNonOrthogonalCorrectors 0; @@ -88,5 +76,3 @@ relaxationFactors h 0.99; } } - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/0/U b/multiple-perpendicular-flaps/fluid-openfoam/0/U index 9f67e7a47..bfe8f783a 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/0/U +++ b/multiple-perpendicular-flaps/fluid-openfoam/0/U @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -46,6 +44,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/0/p b/multiple-perpendicular-flaps/fluid-openfoam/0/p index ff622213b..88d18a3cf 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/0/p +++ b/multiple-perpendicular-flaps/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -49,5 +48,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/0/phi b/multiple-perpendicular-flaps/fluid-openfoam/0/phi index 176ef2859..19af7d3fc 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/0/phi +++ b/multiple-perpendicular-flaps/fluid-openfoam/0/phi @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class surfaceScalarField; - location "0"; object phi; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 3 -1 0 0 0 0]; @@ -49,6 +47,3 @@ boundaryField value nonuniform 0; } } - - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/0/pointDisplacement b/multiple-perpendicular-flaps/fluid-openfoam/0/pointDisplacement index 7286c6d38..0c294a8fa 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/0/pointDisplacement +++ b/multiple-perpendicular-flaps/fluid-openfoam/0/pointDisplacement @@ -5,7 +5,6 @@ FoamFile class pointVectorField; object pointDisplacement; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; @@ -52,5 +51,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/constant/dynamicMeshDict b/multiple-perpendicular-flaps/fluid-openfoam/constant/dynamicMeshDict index 2d8f04445..a4c6fd577 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/constant/dynamicMeshDict +++ b/multiple-perpendicular-flaps/fluid-openfoam/constant/dynamicMeshDict @@ -3,21 +3,16 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object dynamicMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +dynamicFvMesh dynamicMotionSolverFvMesh; -dynamicFvMesh dynamicMotionSolverFvMesh; +motionSolverLibs ("libfvMotionSolvers.so"); -motionSolverLibs ("libfvMotionSolvers.so"); - -solver displacementLaplacian; +solver displacementLaplacian; displacementLaplacianCoeffs { - diffusivity quadratic inverseDistance (flap1); diffusivity quadratic inverseDistance (flap2); - } diff --git a/multiple-perpendicular-flaps/fluid-openfoam/constant/transportProperties b/multiple-perpendicular-flaps/fluid-openfoam/constant/transportProperties index bc81706ca..60d9ff9a3 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/constant/transportProperties +++ b/multiple-perpendicular-flaps/fluid-openfoam/constant/transportProperties @@ -3,13 +3,9 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu nu [ 0 2 -1 0 0 0 0 ] 1e-03; - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/constant/turbulenceProperties b/multiple-perpendicular-flaps/fluid-openfoam/constant/turbulenceProperties index a74ee048f..592f6d52d 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/constant/turbulenceProperties +++ b/multiple-perpendicular-flaps/fluid-openfoam/constant/turbulenceProperties @@ -3,11 +3,7 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/blockMeshDict b/multiple-perpendicular-flaps/fluid-openfoam/system/blockMeshDict index c58e95294..ac238c421 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/blockMeshDict +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/blockMeshDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // scale 1.; @@ -21,6 +20,7 @@ z1 1.; z2 4.; w 0; + vertices ( ($x0 $z0 $w ) // 0 @@ -62,8 +62,6 @@ vertices ($x3 $z2 1 ) // 33 ($x4 $z2 1 ) // 34 ($x5 $z2 1 ) // 35 - - ); // Grading @@ -108,12 +106,6 @@ blocks hex ( 9 10 16 15 27 28 34 33 ) ($h2 $v2 1) simpleGrading (1 1.2 1) - - -); - -edges -( ); boundary @@ -210,5 +202,3 @@ boundary ); } ); - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/controlDict b/multiple-perpendicular-flaps/fluid-openfoam/system/controlDict index 19433cd34..2b316a90a 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/controlDict +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/controlDict @@ -3,14 +3,10 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Note: With OpenFOAM v1806 and OpenFOAM 6, the DyM solvers -// were marked deprecated and merged into their respective standard solvers. -application pimpleFoam; // OpenFOAM v1806, OpenFOAM 6, or newer +application pimpleFoam; // latest OpenFOAM // application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older startFrom startTime; diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/decomposeParDict b/multiple-perpendicular-flaps/fluid-openfoam/system/decomposeParDict index 32d1262d7..493cdb633 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/decomposeParDict +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/decomposeParDict @@ -1,8 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + class dictionary; + object decomposeParDict; + format ascii; } numberOfSubdomains 4; diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/fvSchemes b/multiple-perpendicular-flaps/fluid-openfoam/system/fvSchemes index 812dea539..80c096192 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/fvSchemes +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/fvSchemes @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { @@ -39,6 +37,3 @@ snGradSchemes { default corrected; } - - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/fvSolution b/multiple-perpendicular-flaps/fluid-openfoam/system/fvSolution index 134915d5f..064d7f372 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/fvSolution +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -75,7 +73,3 @@ potentialFlow { nNonOrthogonalCorrectors 10; } - - - -// ************************************************************************* // diff --git a/multiple-perpendicular-flaps/fluid-openfoam/system/preciceDict b/multiple-perpendicular-flaps/fluid-openfoam/system/preciceDict index f53de6925..d38366ad1 100644 --- a/multiple-perpendicular-flaps/fluid-openfoam/system/preciceDict +++ b/multiple-perpendicular-flaps/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/partitioned-elastic-beam/visualize.py b/partitioned-elastic-beam/visualize.py index 3f0734a02..bbc97956d 100755 --- a/partitioned-elastic-beam/visualize.py +++ b/partitioned-elastic-beam/visualize.py @@ -25,7 +25,7 @@ def join_frd(frd1, frd2): with open(frd1, "r") as f1, open(frd2, "r") as f2, open("beam_full.frd", "w") as fp: # copy frd header in new file - for i in xrange(11): + for i in range(11): fp.write(f1.readline()) f2.readline() @@ -72,8 +72,8 @@ def join_frd(frd1, frd2): fp.write(" -3\n") # merging blocks of lines for each step - for i in xrange(nsteps): - print "step", i + 1 + for i in range(nsteps): + print("step", i + 1) # step header fp.write(f1.readline()) f2.readline() @@ -81,7 +81,7 @@ def join_frd(frd1, frd2): line_f1 = line_f1[:33] + str(nsizem) + line_f1[36:] fp.write(line_f1) f2.readline() - for j in xrange(5): + for j in range(5): fp.write(f1.readline()) f2.readline() diff --git a/partitioned-heat-conduction-complex/fenics/heat.py b/partitioned-heat-conduction-complex/fenics/heat.py index dd9d2390a..9ba1f519c 100644 --- a/partitioned-heat-conduction-complex/fenics/heat.py +++ b/partitioned-heat-conduction-complex/fenics/heat.py @@ -165,10 +165,10 @@ def determine_gradient(V_g, u, flux): mesh_rank.rename("myRank", "") # Generating output files -temperature_out = File("out/%s.pvd" % precice.get_participant_name()) -ref_out = File("out/ref%s.pvd" % precice.get_participant_name()) -error_out = File("out/error%s.pvd" % precice.get_participant_name()) -ranks = File("out/ranks%s.pvd" % precice.get_participant_name()) +temperature_out = File("output/%s.pvd" % precice.get_participant_name()) +ref_out = File("output/ref%s.pvd" % precice.get_participant_name()) +error_out = File("output/error%s.pvd" % precice.get_participant_name()) +ranks = File("output/ranks%s.pvd" % precice.get_participant_name()) # output solution and reference solution at t=0, n=0 n = 0 diff --git a/partitioned-heat-conduction-complex/fenics/run.sh b/partitioned-heat-conduction-complex/fenics/run.sh index e31f07a10..0b375221b 100755 --- a/partitioned-heat-conduction-complex/fenics/run.sh +++ b/partitioned-heat-conduction-complex/fenics/run.sh @@ -4,10 +4,10 @@ set -e -u while getopts ":dn" opt; do case ${opt} in d) - python3 heat.py -d --error-tol 10e-3 + python3 heat.py -d -a ;; n) - python3 heat.py -n --error-tol 10e-3 + python3 heat.py -n -a ;; \?) echo "Usage: cmd [-d] [-n]" diff --git a/partitioned-heat-conduction/fenics/heat.py b/partitioned-heat-conduction/fenics/heat.py index e7113f570..e7b7f6529 100644 --- a/partitioned-heat-conduction/fenics/heat.py +++ b/partitioned-heat-conduction/fenics/heat.py @@ -148,10 +148,10 @@ def determine_gradient(V_g, u, flux): mesh_rank.rename("myRank", "") # Generating output files -temperature_out = File("out/%s.pvd" % precice.get_participant_name()) -ref_out = File("out/ref%s.pvd" % precice.get_participant_name()) -error_out = File("out/error%s.pvd" % precice.get_participant_name()) -ranks = File("out/ranks%s.pvd" % precice.get_participant_name()) +temperature_out = File("output/%s.pvd" % precice.get_participant_name()) +ref_out = File("output/ref%s.pvd" % precice.get_participant_name()) +error_out = File("output/error%s.pvd" % precice.get_participant_name()) +ranks = File("output/ranks%s.pvd" % precice.get_participant_name()) # output solution and reference solution at t=0, n=0 n = 0 @@ -170,7 +170,7 @@ def determine_gradient(V_g, u, flux): if problem is ProblemType.DIRICHLET: flux = Function(V_g) - flux.rename("Flux", "") + flux.rename("Heat-Flux", "") while precice.is_coupling_ongoing(): diff --git a/partitioned-heat-conduction/fenics/precice-adapter-config-D.json b/partitioned-heat-conduction/fenics/precice-adapter-config-D.json index c2a7788c0..7989ba340 100644 --- a/partitioned-heat-conduction/fenics/precice-adapter-config-D.json +++ b/partitioned-heat-conduction/fenics/precice-adapter-config-D.json @@ -3,7 +3,7 @@ "config_file_name": "../precice-config.xml", "interface": { "coupling_mesh_name": "Dirichlet-Mesh", - "write_data_name": "Flux", + "write_data_name": "Heat-Flux", "read_data_name": "Temperature" } } diff --git a/partitioned-heat-conduction/fenics/precice-adapter-config-N.json b/partitioned-heat-conduction/fenics/precice-adapter-config-N.json index 36ea15d19..2afd52ce3 100644 --- a/partitioned-heat-conduction/fenics/precice-adapter-config-N.json +++ b/partitioned-heat-conduction/fenics/precice-adapter-config-N.json @@ -4,6 +4,6 @@ "interface": { "coupling_mesh_name": "Neumann-Mesh", "write_data_name": "Temperature", - "read_data_name": "Flux" + "read_data_name": "Heat-Flux" } } diff --git a/partitioned-heat-conduction/fenics/problem_setup.py b/partitioned-heat-conduction/fenics/problem_setup.py index cb1b164af..b85f30358 100644 --- a/partitioned-heat-conduction/fenics/problem_setup.py +++ b/partitioned-heat-conduction/fenics/problem_setup.py @@ -1,16 +1,14 @@ """ -Problem setup for partitioned-heat-conduction/fenics-fenics tutorial +Problem setup for partitioned-heat-conduction/fenics tutorial """ -from fenics import SubDomain, Point, RectangleMesh, near, Function, VectorFunctionSpace, Expression +from fenics import SubDomain, Point, RectangleMesh, near, Function, Expression from my_enums import DomainPart y_bottom, y_top = 0, 1 x_left, x_right = 0, 2 x_coupling = 1.0 # x coordinate of coupling interface -radius = 0.2 -midpoint = Point(0.5, 0.5) class ExcludeStraightBoundary(SubDomain): @@ -36,9 +34,6 @@ def inside(self, x, on_boundary): def get_geometry(domain_part): nx = ny = 9 - low_resolution = 5 - high_resolution = 5 - n_vertices = 20 if domain_part is DomainPart.LEFT: p0 = Point(x_left, y_bottom) diff --git a/partitioned-heat-conduction/fenics/run.sh b/partitioned-heat-conduction/fenics/run.sh index e31f07a10..e51fb750b 100755 --- a/partitioned-heat-conduction/fenics/run.sh +++ b/partitioned-heat-conduction/fenics/run.sh @@ -1,6 +1,14 @@ #!/bin/sh set -e -u +usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } + +# Check if no input argument was provided +if [ -z "$*" ] ; then + usage +fi + +# Select appropriate case while getopts ":dn" opt; do case ${opt} in d) @@ -9,8 +17,8 @@ while getopts ":dn" opt; do n) python3 heat.py -n --error-tol 10e-3 ;; - \?) - echo "Usage: cmd [-d] [-n]" + *) + usage ;; esac done diff --git a/partitioned-heat-conduction/nutils/heat.py b/partitioned-heat-conduction/nutils/heat.py index 16c00726e..d2045005f 100644 --- a/partitioned-heat-conduction/nutils/heat.py +++ b/partitioned-heat-conduction/nutils/heat.py @@ -68,8 +68,8 @@ def main(side='Dirichlet'): vertex_ids = interface.set_mesh_vertices(mesh_id, vertices) # coupling data - write_data = "Temperature" if side == "Neumann" else "Flux" - read_data = "Flux" if side == "Neumann" else "Temperature" + write_data = "Temperature" if side == "Neumann" else "Heat-Flux" + read_data = "Heat-Flux" if side == "Neumann" else "Temperature" write_data_id = interface.get_data_id(write_data, mesh_id) read_data_id = interface.get_data_id(read_data, mesh_id) diff --git a/partitioned-heat-conduction/nutils/run.sh b/partitioned-heat-conduction/nutils/run.sh index 43e97b70f..b3048a04f 100755 --- a/partitioned-heat-conduction/nutils/run.sh +++ b/partitioned-heat-conduction/nutils/run.sh @@ -1,6 +1,13 @@ #!/bin/sh set -e -u +usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } + +# Check if no input argument was provided +if [ -z "$*" ] ; then + usage +fi + while getopts ":dn" opt; do case ${opt} in d) @@ -11,8 +18,8 @@ while getopts ":dn" opt; do rm -rf Neumann-*.vtk python3 heat.py --side=Neumann ;; - \?) - echo "Usage: cmd [-d] [-n]" + *) + usage ;; esac done diff --git a/partitioned-heat-conduction/openfoam-dirichlet/0.orig/T b/partitioned-heat-conduction/openfoam-dirichlet/0.orig/T new file mode 100644 index 000000000..fed3ddbc4 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/0.orig/T @@ -0,0 +1,35 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} + +dimensions [0 0 0 1 0 0 0]; + + +internalField uniform 0; + +boundaryField +{ + interface + { + type fixedValue; + value uniform 2; + } + + DirichletBoundary + { + type groovyBC; + variables "val=1+pow(pos().x,2)+(3*pow(pos().y,2))+1.3*time();"; + valueExpression "val"; + value uniform 0; + evaluateDuringConstruction 1; + } + + defaultFaces + { + type empty; + } +} diff --git a/partitioned-heat-conduction/openfoam-dirichlet/clean.sh b/partitioned-heat-conduction/openfoam-dirichlet/clean.sh new file mode 100755 index 000000000..1d4095dbf --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/clean.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . +rm -rfv 0 diff --git a/partitioned-heat-conduction/openfoam-dirichlet/constant/transportProperties b/partitioned-heat-conduction/openfoam-dirichlet/constant/transportProperties new file mode 100644 index 000000000..3ce99aead --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/constant/transportProperties @@ -0,0 +1,9 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} + +DT DT [ 0 2 -1 0 0 0 0 ] 1; diff --git a/partitioned-heat-conduction/openfoam-dirichlet/run.sh b/partitioned-heat-conduction/openfoam-dirichlet/run.sh new file mode 100755 index 000000000..d9334f454 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/run.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e -u + +blockMesh +touch openfoam-dirichlet.foam +./setInitialField.sh + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-heat-conduction/openfoam-dirichlet/setInitialField.sh b/partitioned-heat-conduction/openfoam-dirichlet/setInitialField.sh new file mode 100755 index 000000000..bf3dfd29c --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/setInitialField.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +# Remove the old directory and copy the uninitialized field +rm -rf ./0 +cp -r ./0.orig 0 +# Initialize the new field +funkySetFields -keepPatches -field T -expression '1+pow(pos().x,2)+(3*pow(pos().y,2))+1.3*time()' -time '0' diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/blockMeshDict b/partitioned-heat-conduction/openfoam-dirichlet/system/blockMeshDict new file mode 100644 index 000000000..33357badb --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/blockMeshDict @@ -0,0 +1,50 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} + +vertices +( + + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + + (0 0 .1) + (1 0 .1) + (1 1 .1) + (0 1 .1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (100 100 1) simpleGrading (1 1 1) +); + +boundary +( + + interface + { + type patch; + faces + ( + (1 2 6 5) + ); + } + + DirichletBoundary + { + type patch; + faces + ( + (4 7 3 0) + (7 6 2 3) + (4 0 1 5) + ); + } +); diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/controlDict b/partitioned-heat-conduction/openfoam-dirichlet/system/controlDict new file mode 100644 index 000000000..31a7ba62d --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/controlDict @@ -0,0 +1,51 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} + +// Make sure you build the solver located +// in ../../openfoam-solver/ before running +// the case +application heatTransfer; + +libs ( "libgroovyBC.so" ) ; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.1; + +writeControl runTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable false; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/decomposeParDict b/partitioned-heat-conduction/openfoam-dirichlet/system/decomposeParDict new file mode 100644 index 000000000..ad99cf6c5 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/decomposeParDict @@ -0,0 +1,16 @@ +FoamFile { + version 2.0; + class dictionary; + object decomposeParDict; + format ascii; +} + +numberOfSubdomains 2; + +method simple; + +simpleCoeffs +{ + n (2 1 1); + delta 0.001; +} diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/fvSchemes b/partitioned-heat-conduction/openfoam-dirichlet/system/fvSchemes new file mode 100644 index 000000000..6719e4491 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/fvSchemes @@ -0,0 +1,39 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(T) Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(DT,T) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/fvSolution b/partitioned-heat-conduction/openfoam-dirichlet/system/fvSolution new file mode 100644 index 000000000..30a932586 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/fvSolution @@ -0,0 +1,23 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} + +solvers +{ + T + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 2; +} diff --git a/partitioned-heat-conduction/openfoam-dirichlet/system/preciceDict b/partitioned-heat-conduction/openfoam-dirichlet/system/preciceDict new file mode 100644 index 000000000..8ef48a201 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-dirichlet/system/preciceDict @@ -0,0 +1,42 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Dirichlet; + +modules (CHT); + +interfaces +{ + Interface1 + { + mesh Dirichlet-Mesh; + patches (interface); + + readData + ( + Temperature + ); + + writeData + ( + Heat-Flux + ); + }; +}; + +CHT +{ + // fenics and nutils use different + // sign conventions here, so we + // select -1 for compatibility + // reasons + k [ 1 1 -3 -1 0 0 0 ] -1; + solverType "basic"; +}; diff --git a/partitioned-heat-conduction/openfoam-neumann/0.orig/T b/partitioned-heat-conduction/openfoam-neumann/0.orig/T new file mode 100644 index 000000000..01f8fc1af --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/0.orig/T @@ -0,0 +1,35 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} + +dimensions [0 0 0 1 0 0 0]; + + +internalField uniform 0; + +boundaryField +{ + interface + { + type fixedGradient; + gradient uniform -2; + } + + DirichletBoundary + { + type groovyBC; + variables "val=1+pow(pos().x,2)+(3*pow(pos().y,2))+1.3*time();"; + valueExpression "val"; + value uniform 0; + evaluateDuringConstruction 1; + } + + defaultFaces + { + type empty; + } +} diff --git a/partitioned-heat-conduction/openfoam-neumann/clean.sh b/partitioned-heat-conduction/openfoam-neumann/clean.sh new file mode 100755 index 000000000..1d4095dbf --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/clean.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . +rm -rfv 0 diff --git a/partitioned-heat-conduction/openfoam-neumann/constant/transportProperties b/partitioned-heat-conduction/openfoam-neumann/constant/transportProperties new file mode 100644 index 000000000..3ce99aead --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/constant/transportProperties @@ -0,0 +1,9 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} + +DT DT [ 0 2 -1 0 0 0 0 ] 1; diff --git a/partitioned-heat-conduction/openfoam-neumann/run.sh b/partitioned-heat-conduction/openfoam-neumann/run.sh new file mode 100755 index 000000000..78b68a942 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/run.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e -u + +blockMesh +touch openfoam-neumann.foam +./setInitialField.sh + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-heat-conduction/openfoam-neumann/setInitialField.sh b/partitioned-heat-conduction/openfoam-neumann/setInitialField.sh new file mode 100755 index 000000000..bf3dfd29c --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/setInitialField.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +# Remove the old directory and copy the uninitialized field +rm -rf ./0 +cp -r ./0.orig 0 +# Initialize the new field +funkySetFields -keepPatches -field T -expression '1+pow(pos().x,2)+(3*pow(pos().y,2))+1.3*time()' -time '0' diff --git a/partitioned-heat-conduction/openfoam-neumann/system/blockMeshDict b/partitioned-heat-conduction/openfoam-neumann/system/blockMeshDict new file mode 100644 index 000000000..972d11103 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/system/blockMeshDict @@ -0,0 +1,53 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} + +convertToMeters 1; + +vertices +( + + (1 0 0) + (2 0 0) + (2 1 0) + (1 1 0) + + (1 0 .1) + (2 0 .1) + (2 1 .1) + (1 1 .1) + +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (100 100 1) simpleGrading (1 1 1) +); + +boundary +( + + interface + { + type patch; + faces + ( + (4 7 3 0) + ); + } + + DirichletBoundary + { + type patch; + faces + ( + (1 2 6 5) + (4 0 1 5) + (7 6 2 3) + ); + } +); diff --git a/partitioned-heat-conduction/openfoam-neumann/system/controlDict b/partitioned-heat-conduction/openfoam-neumann/system/controlDict new file mode 100644 index 000000000..31a7ba62d --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/system/controlDict @@ -0,0 +1,51 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} + +// Make sure you build the solver located +// in ../../openfoam-solver/ before running +// the case +application heatTransfer; + +libs ( "libgroovyBC.so" ) ; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.1; + +writeControl runTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable false; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-heat-conduction/openfoam-neumann/system/fvSchemes b/partitioned-heat-conduction/openfoam-neumann/system/fvSchemes new file mode 100644 index 000000000..113863ee9 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/system/fvSchemes @@ -0,0 +1,39 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default none; + grad(T) Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(DT,T) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-heat-conduction/openfoam-neumann/system/fvSolution b/partitioned-heat-conduction/openfoam-neumann/system/fvSolution new file mode 100644 index 000000000..7da9a801a --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/system/fvSolution @@ -0,0 +1,23 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} + +solvers +{ + T + { + solver PCG; + preconditioner DIC; + tolerance 1e-12; + relTol 0; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} diff --git a/partitioned-heat-conduction/openfoam-neumann/system/preciceDict b/partitioned-heat-conduction/openfoam-neumann/system/preciceDict new file mode 100644 index 000000000..269196a05 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-neumann/system/preciceDict @@ -0,0 +1,42 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Neumann; + +modules (CHT); + +interfaces +{ + Interface1 + { + mesh Neumann-Mesh; + patches (interface); + + readData + ( + Heat-Flux + ); + + writeData + ( + Temperature + ); + }; +}; + +CHT +{ + // fenics and nutils use different + // sign conventions here, so we + // select -1 for compatibility + // reasons + k [ 1 1 -3 -1 0 0 0 ] -1; + solverType "basic"; +}; diff --git a/partitioned-heat-conduction/openfoam-solver/Make/files b/partitioned-heat-conduction/openfoam-solver/Make/files new file mode 100644 index 000000000..5721e3a21 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/Make/files @@ -0,0 +1,3 @@ +heatTransfer.C + +EXE = $(FOAM_USER_APPBIN)/heatTransfer diff --git a/partitioned-heat-conduction/openfoam-solver/Make/options b/partitioned-heat-conduction/openfoam-solver/Make/options new file mode 100644 index 000000000..04ef6c148 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/Make/options @@ -0,0 +1,8 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/partitioned-heat-conduction/openfoam-solver/clean.sh b/partitioned-heat-conduction/openfoam-solver/clean.sh new file mode 100755 index 000000000..0207cc569 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/clean.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e -u + +wclean diff --git a/partitioned-heat-conduction/openfoam-solver/createFields.H b/partitioned-heat-conduction/openfoam-solver/createFields.H new file mode 100644 index 000000000..6f7ac0452 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/createFields.H @@ -0,0 +1,49 @@ +Info<< "Reading field T\n" << endl; + +volScalarField T +( + IOobject + ( + "T", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + + +Info<< "Reading diffusivity DT\n" << endl; + +volScalarField DT +( + IOobject + ( + "DT", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar(dimViscosity, Zero) +); + +if (!DT.headerOk()) +{ + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); + DT = dimensionedScalar("DT", dimViscosity, transportProperties); +} + +#include "createFvOptions.H" diff --git a/partitioned-heat-conduction/openfoam-solver/heatTransfer.C b/partitioned-heat-conduction/openfoam-solver/heatTransfer.C new file mode 100644 index 000000000..6194f6fc1 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/heatTransfer.C @@ -0,0 +1,114 @@ +// This solver is based on previous work of OpenCFD Ltd. In particular, major code +// parts are part of the laplacianFoam solver of OpenFOAM 2012, which served as a +// basis for this solver. +// ------------------------------------------------------------------------------- +// Application +// heatTransfer +// +// Group +// grpBasicSolvers +// +// Description +// Modified version of the Laplace equation solver for a scalar quantity with +// a non-zero RHS. +// +// \heading Solver details +// The solver is applicable to, e.g. for thermal diffusion in a solid. The +// equation is given by: +// +// \f[ +// \ddt{T} = \div \left( D_T \grad T \right) + F +// \f] +// +// Where: +// \vartable +// T | Scalar field which is solved for, e.g. temperature +// D_T | Diffusion coefficient +// F | The RHS which is defined as: beta - 2 - 2 * alpha +// \endvartable +// +// \heading Required fields +// \plaintable +// T | Scalar field which is solved for, e.g. temperature +// \endplaintable + + +#include "fvCFD.H" +#include "fvOptions.H" +#include "simpleControl.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addNote + ( + "Laplace equation solver for a scalar quantity." + ); + + #include "postProcess.H" + + #include "addCheckCaseOptions.H" + #include "setRootCaseLists.H" + #include "createTime.H" + #include "createMesh.H" + + simpleControl simple(mesh); + + #include "createFields.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nCalculating temperature distribution\n" << endl; + + const double alpha = 3; + const double beta = 1.3; + const double rhs = beta - 2 - 2 * alpha; + + volScalarField f + ( + IOobject + ( + "RHS", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar( + "Tdim", + dimensionSet(0, 0, -1, 1, 0, 0, 0), + Foam::scalar(rhs)) + ); + + while (simple.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + while (simple.correctNonOrthogonal()) + { + fvScalarMatrix TEqn + ( + fvm::ddt(T) - fvm::laplacian(DT, T) - fvm::Su(f,T) + == + fvOptions(T) + ); + + fvOptions.constrain(TEqn); + TEqn.solve(); + fvOptions.correct(T); + } + + #include "write.H" + + runTime.printExecutionTime(Info); + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/partitioned-heat-conduction/openfoam-solver/write.H b/partitioned-heat-conduction/openfoam-solver/write.H new file mode 100644 index 000000000..c4d405d44 --- /dev/null +++ b/partitioned-heat-conduction/openfoam-solver/write.H @@ -0,0 +1,58 @@ + if (runTime.writeTime()) + { + volVectorField gradT(fvc::grad(T)); + + volScalarField gradTx + ( + IOobject + ( + "gradTx", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + gradT.component(vector::X) + ); + + volScalarField gradTy + ( + IOobject + ( + "gradTy", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + gradT.component(vector::Y) + ); + + volScalarField gradTz + ( + IOobject + ( + "gradTz", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + gradT.component(vector::Z) + ); + + volVectorField DTgradT + ( + IOobject + ( + "flux", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + DT*gradT + ); + + runTime.write(); + } diff --git a/partitioned-heat-conduction/precice-config.xml b/partitioned-heat-conduction/precice-config.xml index a810f285d..280fcb2f2 100644 --- a/partitioned-heat-conduction/precice-config.xml +++ b/partitioned-heat-conduction/precice-config.xml @@ -1,61 +1,75 @@ - - + - - + - - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - - - - - - - + + + + + + + + - - - - - + + + + + - diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U index fd165fe4e..6e6f17645 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties index c055a4bfa..f2445cbda 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties index 2c55a8b28..592f6d52d 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict index a2b080b83..2513a3ba1 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant/polyMesh"; object blockMeshDict; } diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict index 9fe0ab9f5..83323d140 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } @@ -21,7 +20,7 @@ deltaT 0.01; writeControl adjustableRunTime; -writeInterval 0.01; +writeInterval 0.1; purgeWrite 0; diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict index ad99cf6c5..9a1361c29 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict @@ -1,8 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + class dictionary; + object decomposeParDict; + format ascii; } numberOfSubdomains 2; diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes index a22010ae4..80c096192 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict index b496662d1..2e0095445 100644 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } @@ -31,4 +30,4 @@ interfaces PressureGradient ); }; -}; \ No newline at end of file +}; diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/U b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/U index fd165fe4e..6e6f17645 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/U +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/U @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties index 6bc1693b3..88e5d6353 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object thermodynamicProperties; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties index 0f39f4183..cd90b42ab 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties index 2c55a8b28..592f6d52d 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict index a2b080b83..2513a3ba1 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant/polyMesh"; object blockMeshDict; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict index 162aef6ed..f1926eb39 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } @@ -21,7 +20,7 @@ deltaT 0.01; writeControl adjustableRunTime; -writeInterval 0.01; +writeInterval 0.1; purgeWrite 0; diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes index edf56a6dc..6061be838 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution index 506c2ecf8..f846b32aa 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict index b496662d1..2e0095445 100644 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } @@ -31,4 +30,4 @@ interfaces PressureGradient ); }; -}; \ No newline at end of file +}; diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/0/U b/partitioned-pipe/fluid2-openfoam-pimplefoam/0/U index 94afa03ee..b3dbea82c 100644 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/0/U +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/0/U @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties index c055a4bfa..f2445cbda 100644 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties index 2c55a8b28..592f6d52d 100644 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict index 9fe0ab9f5..839905b56 100644 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict @@ -21,7 +21,7 @@ deltaT 0.01; writeControl adjustableRunTime; -writeInterval 0.01; +writeInterval 0.1; purgeWrite 0; diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U index 94afa03ee..b3dbea82c 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties index aa3c63f53..a8f8fd1f6 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object thermodynamicProperties; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties index 0f39f4183..cd90b42ab 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties index 2c55a8b28..592f6d52d 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict index 56363d94b..f5f246fa0 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant/polyMesh"; object blockMeshDict; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict index 162aef6ed..f1926eb39 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } @@ -21,7 +20,7 @@ deltaT 0.01; writeControl adjustableRunTime; -writeInterval 0.01; +writeInterval 0.1; purgeWrite 0; diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict index ad99cf6c5..9a1361c29 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict @@ -1,8 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + class dictionary; + object decomposeParDict; + format ascii; } numberOfSubdomains 2; diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes index edf56a6dc..6061be838 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution index 506c2ecf8..f846b32aa 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict index f17b23d93..593f7facb 100644 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } @@ -31,4 +30,4 @@ interfaces Pressure ); }; -}; \ No newline at end of file +}; diff --git a/perpendicular-flap/README.md b/perpendicular-flap/README.md index 96724de51..41da352e3 100644 --- a/perpendicular-flap/README.md +++ b/perpendicular-flap/README.md @@ -21,7 +21,7 @@ The simulated flow domain is 6 units long (x) and 4 units tall (y). The flap is Fluid participant: -* OpenFOAM. For older OpenFOAM versions, the solver name differs: If you are using OpenFOAM v1712 / 5.x or older have a look at `fluid-openfoam/system/controlDict` and set the appropriate solver name. The solver can run in parallel using the command line argument `run.sh -parallel`. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). +* OpenFOAM (pimpleFoam). In case you are using a very old OpenFOAM version, you will need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). * 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 v6.0. @@ -35,9 +35,11 @@ Solid participant: * deal.II. This tutorial works only with `Model = linear` since the deal.II codes were developed with read data `Stress` instead of `Force` as applied here (example given in Turek-Hron-FSI) in the first place. The `./run.sh` script takes the compiled executable `elasticity` as input argument (`run.sh -e=/path/to/elasticity`) and is required in case the executable is not discoverable at runtime (e.g. has been added to the system `PATH`). For more information, have a look at the [deal.II adapter documentation](https://www.precice.org/adapter-dealii-overview.html). +* DUNE. For more information, have a look at the [experimental DUNE adapter](https://github.com/precice/dune-adapter) and send us your feedback. + ## Running the Simulation -All listed solvers can be used in order to run the simulation. Open two separate terminals and start the desired fluid and solid participant by calling the respective run script `run.sh` located in the participant directory. For example: +All listed solvers can be used in order to run the simulation. OpenFOAM can be executed in parallel using `run.sh -parallel`. The default setting uses 4 MPI ranks. Open two separate terminals and start the desired fluid and solid participant by calling the respective run script `run.sh` located in the participant directory. For example: ```bash cd fluid-openfoam diff --git a/perpendicular-flap/fluid-openfoam/0/U b/perpendicular-flap/fluid-openfoam/0/U index 9bfbc4ea3..5ad191331 100644 --- a/perpendicular-flap/fluid-openfoam/0/U +++ b/perpendicular-flap/fluid-openfoam/0/U @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -41,6 +39,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/0/p b/perpendicular-flap/fluid-openfoam/0/p index a558fafcf..9ab45570b 100644 --- a/perpendicular-flap/fluid-openfoam/0/p +++ b/perpendicular-flap/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -44,5 +43,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/0/phi b/perpendicular-flap/fluid-openfoam/0/phi index 06c61d9c4..9221e0315 100644 --- a/perpendicular-flap/fluid-openfoam/0/phi +++ b/perpendicular-flap/fluid-openfoam/0/phi @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class surfaceScalarField; - location "0"; object phi; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 3 -1 0 0 0 0]; @@ -44,6 +42,3 @@ boundaryField value nonuniform 0; } } - - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/0/pointDisplacement b/perpendicular-flap/fluid-openfoam/0/pointDisplacement index c107f3b65..4ac8684e8 100644 --- a/perpendicular-flap/fluid-openfoam/0/pointDisplacement +++ b/perpendicular-flap/fluid-openfoam/0/pointDisplacement @@ -5,7 +5,6 @@ FoamFile class pointVectorField; object pointDisplacement; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; @@ -46,5 +45,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/constant/dynamicMeshDict b/perpendicular-flap/fluid-openfoam/constant/dynamicMeshDict index d323bc059..9f376bcbc 100644 --- a/perpendicular-flap/fluid-openfoam/constant/dynamicMeshDict +++ b/perpendicular-flap/fluid-openfoam/constant/dynamicMeshDict @@ -3,12 +3,9 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object dynamicMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("libfvMotionSolvers.so"); @@ -16,7 +13,5 @@ motionSolverLibs ("libfvMotionSolvers.so"); solver displacementLaplacian; displacementLaplacianCoeffs { - diffusivity quadratic inverseDistance (flap); - -} \ No newline at end of file +} diff --git a/perpendicular-flap/fluid-openfoam/constant/transportProperties b/perpendicular-flap/fluid-openfoam/constant/transportProperties index a323db90a..5383adaad 100644 --- a/perpendicular-flap/fluid-openfoam/constant/transportProperties +++ b/perpendicular-flap/fluid-openfoam/constant/transportProperties @@ -3,13 +3,9 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object transportProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu nu [ 0 2 -1 0 0 0 0 ] 1; - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties b/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties index a74ee048f..592f6d52d 100644 --- a/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties +++ b/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties @@ -3,11 +3,7 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/system/blockMeshDict b/perpendicular-flap/fluid-openfoam/system/blockMeshDict index 4a4116cc3..875f42294 100644 --- a/perpendicular-flap/fluid-openfoam/system/blockMeshDict +++ b/perpendicular-flap/fluid-openfoam/system/blockMeshDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // x0 -3.; x1 -0.05; @@ -77,10 +76,6 @@ blocks simpleGrading (2 2 1) ); -edges -( -); - boundary ( inlet @@ -148,5 +143,3 @@ boundary ); } ); - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/system/controlDict b/perpendicular-flap/fluid-openfoam/system/controlDict index 19433cd34..2b316a90a 100644 --- a/perpendicular-flap/fluid-openfoam/system/controlDict +++ b/perpendicular-flap/fluid-openfoam/system/controlDict @@ -3,14 +3,10 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Note: With OpenFOAM v1806 and OpenFOAM 6, the DyM solvers -// were marked deprecated and merged into their respective standard solvers. -application pimpleFoam; // OpenFOAM v1806, OpenFOAM 6, or newer +application pimpleFoam; // latest OpenFOAM // application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older startFrom startTime; diff --git a/perpendicular-flap/fluid-openfoam/system/decomposeParDict b/perpendicular-flap/fluid-openfoam/system/decomposeParDict index 32d1262d7..31d721d1d 100644 --- a/perpendicular-flap/fluid-openfoam/system/decomposeParDict +++ b/perpendicular-flap/fluid-openfoam/system/decomposeParDict @@ -1,8 +1,8 @@ FoamFile { - version 2.0; - class dictionary; - object decomposeParDict; - format ascii; + version 2.0; + class dictionary; + object decomposeParDict; + format ascii; } numberOfSubdomains 4; diff --git a/perpendicular-flap/fluid-openfoam/system/fvSchemes b/perpendicular-flap/fluid-openfoam/system/fvSchemes index 812dea539..80c096192 100644 --- a/perpendicular-flap/fluid-openfoam/system/fvSchemes +++ b/perpendicular-flap/fluid-openfoam/system/fvSchemes @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { @@ -39,6 +37,3 @@ snGradSchemes { default corrected; } - - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/system/fvSolution b/perpendicular-flap/fluid-openfoam/system/fvSolution index 134915d5f..064d7f372 100644 --- a/perpendicular-flap/fluid-openfoam/system/fvSolution +++ b/perpendicular-flap/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -75,7 +73,3 @@ potentialFlow { nNonOrthogonalCorrectors 10; } - - - -// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/system/preciceDict b/perpendicular-flap/fluid-openfoam/system/preciceDict index 92d739318..1196109c3 100644 --- a/perpendicular-flap/fluid-openfoam/system/preciceDict +++ b/perpendicular-flap/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/perpendicular-flap/images/tutorials-perpendicular-flap-displacement-all-watchpoints.png b/perpendicular-flap/images/tutorials-perpendicular-flap-displacement-all-watchpoints.png index 26a1f1c4d..7fc01ef55 100644 Binary files a/perpendicular-flap/images/tutorials-perpendicular-flap-displacement-all-watchpoints.png and b/perpendicular-flap/images/tutorials-perpendicular-flap-displacement-all-watchpoints.png differ diff --git a/perpendicular-flap/plot-all-displacements.sh b/perpendicular-flap/plot-all-displacements.sh index 05ea08829..bd18f6125 100755 --- a/perpendicular-flap/plot-all-displacements.sh +++ b/perpendicular-flap/plot-all-displacements.sh @@ -4,12 +4,16 @@ gnuplot -p << EOF set grid set title 'x-displacement of the flap tip' set xlabel 'time [s]' - set ylabel 'x-displacement [m]' + set ylabel 'x-displacement [m]' + set term pngcairo enhanced size 900,654 + set output "images/tutorials-perpendicular-flap-displacement-all-watchpoints.png" plot "watchpoints/openfoam-calculix.log" using 1:4 with lines title "OpenFOAM-CalculiX", \ "watchpoints/openfoam-dealii.log" using 1:4 with lines title "OpenFOAM-deal.II", \ "watchpoints/openfoam-fenics.log" using 1:4 with lines title "OpenFOAM-FEniCS", \ "watchpoints/su2-calculix.log" using 1:4 with lines title "SU2-CalculiX", \ "watchpoints/su2-dealii.log" using 1:4 with lines title "SU2-deal.II", \ "watchpoints/su2-fenics.log" using 1:4 with lines title "SU2-FEniCS", \ - "watchpoints/nutils-dealii.log" using 1:4 with lines title "Nutils-deal.II" + "watchpoints/nutils-calculix.log" using 1:4 with lines title "Nutils-CalculiX", \ + "watchpoints/nutils-dealii.log" using 1:4 with lines title "Nutils-deal.II", \ + "watchpoints/nutils-fenics.log" using 1:4 with lines title "Nutils-FEniCS" EOF diff --git a/perpendicular-flap/solid-calculix/all.msh b/perpendicular-flap/solid-calculix/all.msh index 5bfebc2b9..7e196a054 100644 --- a/perpendicular-flap/solid-calculix/all.msh +++ b/perpendicular-flap/solid-calculix/all.msh @@ -737,7 +737,7 @@ 736,-5.000000000000e-02,9.918032786885e-01,0.000000000000e+00 737,-5.000000000000e-02,1.000000000000e+00,1.000000000000e+00 738,-5.000000000000e-02,1.000000000000e+00,0.000000000000e+00 -*ELEMENT, TYPE=C3D8, ELSET=Eall +*ELEMENT, TYPE=C3D8I, ELSET=Eall 1, 1, 2, 3, 4, 5, 6, 7, 8 2, 4, 3, 9, 10, 8, 7, 11, 12 3, 10, 9, 13, 14, 12, 11, 15, 16 diff --git a/perpendicular-flap/solid-calculix/flap.inp b/perpendicular-flap/solid-calculix/flap.inp index 44145246c..4eda56c96 100644 --- a/perpendicular-flap/solid-calculix/flap.inp +++ b/perpendicular-flap/solid-calculix/flap.inp @@ -8,7 +8,7 @@ 3000 *SOLID SECTION, Elset=Eall, Material=EL *STEP, INC=1000000 -*DYNAMIC, ALPHA=0.0 +*DYNAMIC, ALPHA=0.0, DIRECT 1.E-2, 5.0 *BOUNDARY Nfix1, 1, 3 diff --git a/perpendicular-flap/solid-dune/Solid.msh b/perpendicular-flap/solid-dune/Solid.msh new file mode 100755 index 000000000..d14f7cbf7 --- /dev/null +++ b/perpendicular-flap/solid-dune/Solid.msh @@ -0,0 +1,154 @@ +$MeshFormat +2.2 0 8 +$EndMeshFormat +$Nodes +64 +1 -0.05 0 -0.5 +2 -0.05 1 -0.5 +3 0.05 1 -0.5 +4 0.05 0 -0.5 +5 -0.05 0.0666666666665325 -0.5 +6 -0.05 0.1333333333330848 -0.5 +7 -0.05 0.1999999999995569 -0.5 +8 -0.05 0.266666666666029 -0.5 +9 -0.05 0.3333333333325011 -0.5 +10 -0.05 0.3999999999989731 -0.5 +11 -0.05 0.4666666666654452 -0.5 +12 -0.05 0.5333333333321025 -0.5 +13 -0.05 0.599999999998945 -0.5 +14 -0.05 0.6666666666657876 -0.5 +15 -0.05 0.73333333333263 -0.5 +16 -0.05 0.7999999999994725 -0.5 +17 -0.05 0.8666666666663151 -0.5 +18 -0.05 0.9333333333331575 -0.5 +19 -0.0166666666667507 1 -0.5 +20 0.01666666666657628 1 -0.5 +21 0.05 0.9333333333330558 -0.5 +22 0.05 0.866666666666204 -0.5 +23 0.05 0.8 -0.5 +24 0.05 0.7333333333337959 -0.5 +25 0.05 0.6666666666675918 -0.5 +26 0.05 0.6000000000013874 -0.5 +27 0.05 0.5333333333351832 -0.5 +28 0.05 0.466666666668609 -0.5 +29 0.05 0.4000000000016649 -0.5 +30 0.05 0.3333333333347207 -0.5 +31 0.05 0.2666666666677765 -0.5 +32 0.05 0.2000000000008324 -0.5 +33 0.05 0.1333333333338883 -0.5 +34 0.05 0.06666666666694399 -0.5 +35 0.0166666666667507 0 -0.5 +36 -0.01666666666657628 0 -0.5 +37 -0.0166666666665879 0.06666666666666968 -0.5 +38 0.01666666666673907 0.06666666666680683 -0.5 +39 -0.01666666666659953 0.1333333333333527 -0.5 +40 0.01666666666672744 0.1333333333336205 -0.5 +41 -0.01666666666661116 0.1999999999999821 -0.5 +42 0.01666666666671581 0.2000000000004072 -0.5 +43 -0.01666666666662279 0.2666666666666115 -0.5 +44 0.01666666666670419 0.266666666667194 -0.5 +45 -0.01666666666663442 0.333333333333241 -0.5 +46 0.01666666666669255 0.3333333333339808 -0.5 +47 -0.01666666666664605 0.3999999999998704 -0.5 +48 0.01666666666668092 0.4000000000007675 -0.5 +49 -0.01666666666665767 0.4666666666664998 -0.5 +50 0.01666666666666931 0.4666666666675544 -0.5 +51 -0.01666666666666929 0.5333333333331293 -0.5 +52 0.01666666666665767 0.5333333333341564 -0.5 +53 -0.01666666666668093 0.5999999999997592 -0.5 +54 0.01666666666664605 0.6000000000005733 -0.5 +55 -0.01666666666669255 0.666666666666389 -0.5 +56 0.01666666666663442 0.6666666666669904 -0.5 +57 -0.01666666666670419 0.7333333333330185 -0.5 +58 0.0166666666666228 0.7333333333334071 -0.5 +59 -0.01666666666671581 0.7999999999996483 -0.5 +60 0.01666666666661116 0.7999999999998242 -0.5 +61 -0.01666666666672744 0.8666666666662781 -0.5 +62 0.01666666666659953 0.8666666666662408 -0.5 +63 -0.01666666666673907 0.9333333333331235 -0.5 +64 0.0166666666665879 0.9333333333330895 -0.5 +$EndNodes +$Elements +81 +1 1 2 3 1 1 5 +2 1 2 3 1 5 6 +3 1 2 3 1 6 7 +4 1 2 3 1 7 8 +5 1 2 3 1 8 9 +6 1 2 3 1 9 10 +7 1 2 3 1 10 11 +8 1 2 3 1 11 12 +9 1 2 3 1 12 13 +10 1 2 3 1 13 14 +11 1 2 3 1 14 15 +12 1 2 3 1 15 16 +13 1 2 3 1 16 17 +14 1 2 3 1 17 18 +15 1 2 3 1 18 2 +16 1 2 3 2 2 19 +17 1 2 3 2 19 20 +18 1 2 3 2 20 3 +19 1 2 3 3 3 21 +20 1 2 3 3 21 22 +21 1 2 3 3 22 23 +22 1 2 3 3 23 24 +23 1 2 3 3 24 25 +24 1 2 3 3 25 26 +25 1 2 3 3 26 27 +26 1 2 3 3 27 28 +27 1 2 3 3 28 29 +28 1 2 3 3 29 30 +29 1 2 3 3 30 31 +30 1 2 3 3 31 32 +31 1 2 3 3 32 33 +32 1 2 3 3 33 34 +33 1 2 3 3 34 4 +34 1 2 1 4 4 35 +35 1 2 1 4 35 36 +36 1 2 1 4 36 1 +37 3 2 1 1 1 5 37 36 +38 3 2 1 1 36 37 38 35 +39 3 2 1 1 35 38 34 4 +40 3 2 1 1 5 6 39 37 +41 3 2 1 1 37 39 40 38 +42 3 2 1 1 38 40 33 34 +43 3 2 1 1 6 7 41 39 +44 3 2 1 1 39 41 42 40 +45 3 2 1 1 40 42 32 33 +46 3 2 1 1 7 8 43 41 +47 3 2 1 1 41 43 44 42 +48 3 2 1 1 42 44 31 32 +49 3 2 1 1 8 9 45 43 +50 3 2 1 1 43 45 46 44 +51 3 2 1 1 44 46 30 31 +52 3 2 1 1 9 10 47 45 +53 3 2 1 1 45 47 48 46 +54 3 2 1 1 46 48 29 30 +55 3 2 1 1 10 11 49 47 +56 3 2 1 1 47 49 50 48 +57 3 2 1 1 48 50 28 29 +58 3 2 1 1 11 12 51 49 +59 3 2 1 1 49 51 52 50 +60 3 2 1 1 50 52 27 28 +61 3 2 1 1 12 13 53 51 +62 3 2 1 1 51 53 54 52 +63 3 2 1 1 52 54 26 27 +64 3 2 1 1 13 14 55 53 +65 3 2 1 1 53 55 56 54 +66 3 2 1 1 54 56 25 26 +67 3 2 1 1 14 15 57 55 +68 3 2 1 1 55 57 58 56 +69 3 2 1 1 56 58 24 25 +70 3 2 1 1 15 16 59 57 +71 3 2 1 1 57 59 60 58 +72 3 2 1 1 58 60 23 24 +73 3 2 1 1 16 17 61 59 +74 3 2 1 1 59 61 62 60 +75 3 2 1 1 60 62 22 23 +76 3 2 1 1 17 18 63 61 +77 3 2 1 1 61 63 64 62 +78 3 2 1 1 62 64 21 22 +79 3 2 1 1 18 2 19 63 +80 3 2 1 1 63 19 20 64 +81 3 2 1 1 64 20 3 21 +$EndElements diff --git a/perpendicular-flap/solid-dune/clean.sh b/perpendicular-flap/solid-dune/clean.sh new file mode 100755 index 000000000..eaf41de47 --- /dev/null +++ b/perpendicular-flap/solid-dune/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_dune . diff --git a/perpendicular-flap/solid-dune/run.sh b/perpendicular-flap/solid-dune/run.sh new file mode 100755 index 000000000..bbe2d648c --- /dev/null +++ b/perpendicular-flap/solid-dune/run.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e -u + +./dune-perpendicular-flap diff --git a/perpendicular-flap/solid-fenics/solid.py b/perpendicular-flap/solid-fenics/solid.py index 66bcb3a62..8c571c0b6 100644 --- a/perpendicular-flap/solid-fenics/solid.py +++ b/perpendicular-flap/solid-fenics/solid.py @@ -170,7 +170,7 @@ def avg(x_old, x_new, alpha): n = 0 E_ext = 0 -displacement_out = File("Solid/FSI-S/u_fsi.pvd") +displacement_out = File("output/u_fsi.pvd") u_n.rename("Displacement", "") u_np1.rename("Displacement", "") diff --git a/quickstart/README.md b/quickstart/README.md index ab94e6aa1..7bbba725b 100644 --- a/quickstart/README.md +++ b/quickstart/README.md @@ -25,17 +25,17 @@ To get a feeling what preCICE does, watch a [short presentation](https://www.you sudo apt install ./libprecice2_2.3.0_focal.deb ``` - - Are you using something else? Just pick what suits you best on [this overview page](https://www.precice.org/installation-overview.html). - - Facing any problems? [Ask for help](https://www.precice.org/community-channels.html). -2. We will use OpenFOAM here and in many of our tutorial cases, so [install OpenFOAM](https://www.precice.org/adapter-openfoam-support.html): + - Are you using something else? Just pick what suits you best on [this overview page](https://precice.org/installation-overview.html). + - Facing any problems? [Ask for help](https://precice.org/community-channels.html). +2. We will use OpenFOAM here and in many of our tutorial cases, so [install OpenFOAM](https://precice.org/adapter-openfoam-support.html): ```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 v2106: - sudo apt install openfoam2106-dev + # Install OpenFOAM v2112: + sudo apt install openfoam2112-dev # Enable OpenFOAM by default in your system and apply now: - echo "source /usr/lib/openfoam/openfoam2106/etc/bashrc" >> ~/.bashrc + echo "source /usr/lib/openfoam/openfoam2112/etc/bashrc" >> ~/.bashrc source ~/.bashrc ``` @@ -45,7 +45,7 @@ To get a feeling what preCICE does, watch a [short presentation](https://www.you sudo apt install build-essential pkg-config cmake git ``` -4. Download and install the [OpenFOAM-preCICE adapter](https://www.precice.org/adapter-openfoam-get.html): +4. Download and install the [OpenFOAM-preCICE adapter](https://precice.org/adapter-openfoam-get.html): ```bash git clone --branch=master --depth 1 https://github.com/precice/openfoam-adapter @@ -61,7 +61,7 @@ To get a feeling what preCICE does, watch a [short presentation](https://www.you cd tutorials/quickstart ``` -If you prefer to easily try everything in an isolated environment, you may prefer using our [demo virtual machine](https://www.precice.org/installation-vm.html). +If you prefer to easily try everything in an isolated environment, you may prefer using our [demo virtual machine](https://precice.org/installation-vm.html). ## Case setup @@ -123,10 +123,10 @@ Before running the simulation again, cleanup the results and temporary files usi To become a preCICE pro: -- Get an overview of the [preCICE docs](https://www.precice.org/docs.html). +- Get an overview of the [preCICE docs](https://precice.org/docs.html). - See what users talk about in the [preCICE forum](https://precice.discourse.group/). -- Run [tutorials with other coupled solvers](https://www.precice.org/tutorials.html). +- Run [tutorials with other coupled solvers](https://precice.org/tutorials.html). - Watch some [preCICE videos](https://www.youtube.com/c/preCICECoupling/). -- Meet our [community](https://www.precice.org/community.html). -- Find out how to [couple your own solver](https://www.precice.org/couple-your-code-overview.html). -- Tell us [your story](https://www.precice.org/community-projects.html). +- Meet our [community](https://precice.org/community.html). +- Find out how to [couple your own solver](https://precice.org/couple-your-code-overview.html). +- Tell us [your story](https://precice.org/community-projects.html). diff --git a/quickstart/fluid-openfoam/0/U b/quickstart/fluid-openfoam/0/U index 69dfcf932..ebf7eb904 100644 --- a/quickstart/fluid-openfoam/0/U +++ b/quickstart/fluid-openfoam/0/U @@ -5,7 +5,6 @@ FoamFile class volVectorField; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -32,8 +31,8 @@ boundaryField inlet { - type fixedValue; - value uniform (1 0 0); + type fixedValue; + value uniform (1 0 0); } outlet @@ -50,5 +49,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/quickstart/fluid-openfoam/0/p b/quickstart/fluid-openfoam/0/p index 90e9358f4..9bf453010 100644 --- a/quickstart/fluid-openfoam/0/p +++ b/quickstart/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -48,5 +47,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/quickstart/fluid-openfoam/0/pointDisplacement b/quickstart/fluid-openfoam/0/pointDisplacement index e12eaa933..2589eba98 100644 --- a/quickstart/fluid-openfoam/0/pointDisplacement +++ b/quickstart/fluid-openfoam/0/pointDisplacement @@ -5,7 +5,6 @@ FoamFile class pointVectorField; object pointDisplacement; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; @@ -49,5 +48,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/quickstart/fluid-openfoam/constant/dynamicMeshDict b/quickstart/fluid-openfoam/constant/dynamicMeshDict index d323bc059..ea033c8ce 100644 --- a/quickstart/fluid-openfoam/constant/dynamicMeshDict +++ b/quickstart/fluid-openfoam/constant/dynamicMeshDict @@ -3,11 +3,9 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object dynamicMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; @@ -16,7 +14,5 @@ motionSolverLibs ("libfvMotionSolvers.so"); solver displacementLaplacian; displacementLaplacianCoeffs { - diffusivity quadratic inverseDistance (flap); - -} \ No newline at end of file +} diff --git a/quickstart/fluid-openfoam/constant/transportProperties b/quickstart/fluid-openfoam/constant/transportProperties index 870a0bb1c..374372283 100644 --- a/quickstart/fluid-openfoam/constant/transportProperties +++ b/quickstart/fluid-openfoam/constant/transportProperties @@ -1,12 +1,10 @@ FoamFile { - version 2.0; - format ascii; - class dictionary; - location constant; - object transportProperties; + version 2.0; + format ascii; + class dictionary; + object transportProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; diff --git a/quickstart/fluid-openfoam/constant/turbulenceProperties b/quickstart/fluid-openfoam/constant/turbulenceProperties index f906d4153..246999591 100644 --- a/quickstart/fluid-openfoam/constant/turbulenceProperties +++ b/quickstart/fluid-openfoam/constant/turbulenceProperties @@ -3,9 +3,7 @@ FoamFile version 2.0; format ascii; class dictionary; - location constant; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; diff --git a/quickstart/fluid-openfoam/system/blockMeshDict b/quickstart/fluid-openfoam/system/blockMeshDict index c8a955624..a57ae0086 100644 --- a/quickstart/fluid-openfoam/system/blockMeshDict +++ b/quickstart/fluid-openfoam/system/blockMeshDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // scale 1; @@ -195,5 +194,3 @@ boundary ); } ); - -// ************************************************************************* // diff --git a/quickstart/fluid-openfoam/system/controlDict b/quickstart/fluid-openfoam/system/controlDict index 8a241d19b..f3d163f74 100644 --- a/quickstart/fluid-openfoam/system/controlDict +++ b/quickstart/fluid-openfoam/system/controlDict @@ -3,15 +3,11 @@ FoamFile version 2.0; format ascii; class dictionary; - location system; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Note: With OpenFOAM v1806 and OpenFOAM 6, the DyM solvers -// were marked deprecated and merged into their respective standard solvers. -application pimpleFoam; // OpenFOAM v1806, OpenFOAM 6, or newer -// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older +application pimpleFoam; // latest OpenFOAM +// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older startFrom startTime; diff --git a/quickstart/fluid-openfoam/system/decomposeParDict b/quickstart/fluid-openfoam/system/decomposeParDict index dee82bfd0..4a61fe0df 100644 --- a/quickstart/fluid-openfoam/system/decomposeParDict +++ b/quickstart/fluid-openfoam/system/decomposeParDict @@ -1,25 +1,24 @@ FoamFile { - version 2.0; - format ascii; - class dictionary; - location system; - object decomposeParDict; + version 2.0; + format ascii; + class dictionary; + location system; + object decomposeParDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - numberOfSubdomains 2; - - method hierarchical; - hierarchicalCoeffs - { - n (2 1 1); - delta 0.001; - order xyz; - } - - distributed false; - roots - ( - ); +numberOfSubdomains 2; + +method hierarchical; +hierarchicalCoeffs +{ + n (2 1 1); + delta 0.001; + order xyz; +} + +distributed false; +roots +( +); diff --git a/quickstart/fluid-openfoam/system/fvSchemes b/quickstart/fluid-openfoam/system/fvSchemes index c784ff608..2035cd05c 100644 --- a/quickstart/fluid-openfoam/system/fvSchemes +++ b/quickstart/fluid-openfoam/system/fvSchemes @@ -6,36 +6,35 @@ FoamFile location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - ddtSchemes - { - default backward; - } +ddtSchemes +{ + default backward; +} - gradSchemes - { - default cellLimited Gauss linear 1; - } +gradSchemes +{ + default cellLimited Gauss linear 1; +} - divSchemes - { - default none; - div(phi,U) Gauss linearUpwind grad(U); - div((nuEff*dev2(T(grad(U))))) Gauss linear; - } +divSchemes +{ + default none; + div(phi,U) Gauss linearUpwind grad(U); + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} - interpolationSchemes - { - default linear; - } +interpolationSchemes +{ + default linear; +} - laplacianSchemes - { - default Gauss linear corrected; - } +laplacianSchemes +{ + default Gauss linear corrected; +} - snGradSchemes - { - default corrected; - } +snGradSchemes +{ + default corrected; +} diff --git a/quickstart/fluid-openfoam/system/fvSolution b/quickstart/fluid-openfoam/system/fvSolution index 5592bdf82..813288c04 100644 --- a/quickstart/fluid-openfoam/system/fvSolution +++ b/quickstart/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -80,6 +78,3 @@ potentialFlow { nNonOrthogonalCorrectors 1; } - - -// ************************************************************************* // diff --git a/tools/cleaning-tools.sh b/tools/cleaning-tools.sh index 6908bf3cf..c143947c1 100755 --- a/tools/cleaning-tools.sh +++ b/tools/cleaning-tools.sh @@ -73,8 +73,8 @@ clean_fenics() { set -e -u cd "$1" echo "--- Cleaning up FEniCS case in $(pwd)" - rm -fv ./*.pvd spooles.out FSI-S/* - rm -rfv ./out/ + rm -fv spooles.out output/* + rm -rfv ./output/ rm -rfv ./preCICE-output/ clean_precice_logs . ) @@ -116,3 +116,15 @@ clean_su2() { clean_precice_logs . ) } + +clean_dune() { + ( + set -e -u + cd "$1" + echo "--- Cleaning up DUNE case in $(pwd)" + rm -fv ./*.pvd + rm -fv ./*.vtu + rm -rfv ./preCICE-output/ + clean_precice_logs . + ) +} diff --git a/turek-hron-fsi3/README.md b/turek-hron-fsi3/README.md index 5cb474b95..026f69850 100644 --- a/turek-hron-fsi3/README.md +++ b/turek-hron-fsi3/README.md @@ -21,7 +21,7 @@ For more information please refer to the original publication of the benchmark [ Fluid participant: -* OpenFOAM. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). +* OpenFOAM (pimpleFoam). In case you are using a very old OpenFOAM version, you will need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html). {% important %} For the parabolic inflow profile, this tutorial requires groovyBC. groovyBC is part of swak4Foam. You can find more explanations in [openfoamwiki.net](https://openfoamwiki.net/index.php/Contrib/swak4Foam) or get it from an [unofficial GitHub mirror](https://github.com/Unofficial-Extend-Project-Mirror/openfoam-extend-swak4Foam-dev.git). Please follow the building instructions there. @@ -48,7 +48,6 @@ cd solid-dealii ``` You can also run OpenFOAM in parallel by `./run.sh -parallel`. The default setting here uses 25 MPI ranks. You can change this setting in `fluid-openfoam/system/decomposeParDict`. -For older OpenFOAM versions, the solver name will differ. If you are using OpenFOAM v1712 / 5.x or older have a look in the `fluid-openfoam/system/controlDict` file and set the appropriate solver name. You may adjust the end time in the `precice-config.xml`, or interupt the execution earlier if you want. diff --git a/turek-hron-fsi3/fluid-openfoam/0/U b/turek-hron-fsi3/fluid-openfoam/0/U index c194d2abe..298a0809e 100644 --- a/turek-hron-fsi3/fluid-openfoam/0/U +++ b/turek-hron-fsi3/fluid-openfoam/0/U @@ -5,7 +5,6 @@ FoamFile class volVectorField; object U; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; @@ -58,5 +57,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/0/p b/turek-hron-fsi3/fluid-openfoam/0/p index 52e0fdef3..2ea7217ec 100644 --- a/turek-hron-fsi3/fluid-openfoam/0/p +++ b/turek-hron-fsi3/fluid-openfoam/0/p @@ -5,7 +5,6 @@ FoamFile class volScalarField; object p; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; @@ -53,5 +52,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/0/pointDisplacement b/turek-hron-fsi3/fluid-openfoam/0/pointDisplacement index f4644920d..ed27a7b33 100644 --- a/turek-hron-fsi3/fluid-openfoam/0/pointDisplacement +++ b/turek-hron-fsi3/fluid-openfoam/0/pointDisplacement @@ -5,7 +5,6 @@ FoamFile class pointVectorField; object pointDisplacement; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; @@ -54,5 +53,3 @@ boundaryField type empty; } } - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/0/vorticity b/turek-hron-fsi3/fluid-openfoam/0/vorticity index fac7fdf61..38b07dc09 100644 --- a/turek-hron-fsi3/fluid-openfoam/0/vorticity +++ b/turek-hron-fsi3/fluid-openfoam/0/vorticity @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class volVectorField; - location "0"; object vorticity; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; @@ -59,6 +57,3 @@ boundaryField type empty; } } - - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/constant/dynamicMeshDict b/turek-hron-fsi3/fluid-openfoam/constant/dynamicMeshDict index d323bc059..4c29a8391 100644 --- a/turek-hron-fsi3/fluid-openfoam/constant/dynamicMeshDict +++ b/turek-hron-fsi3/fluid-openfoam/constant/dynamicMeshDict @@ -3,20 +3,15 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object dynamicMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dynamicFvMesh dynamicMotionSolverFvMesh; +dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("libfvMotionSolvers.so"); -solver displacementLaplacian; +solver displacementLaplacian; displacementLaplacianCoeffs { - diffusivity quadratic inverseDistance (flap); - -} \ No newline at end of file +} diff --git a/turek-hron-fsi3/fluid-openfoam/constant/transportProperties b/turek-hron-fsi3/fluid-openfoam/constant/transportProperties index 870a0bb1c..ff8f5e907 100644 --- a/turek-hron-fsi3/fluid-openfoam/constant/transportProperties +++ b/turek-hron-fsi3/fluid-openfoam/constant/transportProperties @@ -3,12 +3,11 @@ FoamFile version 2.0; format ascii; class dictionary; - location constant; object transportProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - transportModel Newtonian; +transportModel Newtonian; - nu nu [0 2 -1 0 0 0 0 ] 0.001; - pRef pRef [1 -1 -2 0 0 0 0 ] 0.0; +nu nu [0 2 -1 0 0 0 0 ] 0.001; + +pRef pRef [1 -1 -2 0 0 0 0 ] 0.0; diff --git a/turek-hron-fsi3/fluid-openfoam/constant/turbulenceProperties b/turek-hron-fsi3/fluid-openfoam/constant/turbulenceProperties index f906d4153..246999591 100644 --- a/turek-hron-fsi3/fluid-openfoam/constant/turbulenceProperties +++ b/turek-hron-fsi3/fluid-openfoam/constant/turbulenceProperties @@ -3,9 +3,7 @@ FoamFile version 2.0; format ascii; class dictionary; - location constant; object turbulenceProperties; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; diff --git a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict index c97b97f4f..a51763df9 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict +++ b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // f -0.1; // z-front b 0.1; // z-back @@ -334,10 +333,3 @@ boundary ); } ); - -mergePatchPairs -( -); - - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_double_refined b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_double_refined index 95769ff3e..1050699d4 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_double_refined +++ b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_double_refined @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Geometry parameters f -0.1; // z-front @@ -335,10 +334,3 @@ boundary ); } ); - -mergePatchPairs -( -); - - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_refined b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_refined index 984148a8e..af1315588 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_refined +++ b/turek-hron-fsi3/fluid-openfoam/system/blockMeshDict_refined @@ -5,7 +5,6 @@ FoamFile class dictionary; object blockMeshDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Geometry parameters f -0.1; // z-front @@ -335,10 +334,3 @@ boundary ); } ); - -mergePatchPairs -( -); - - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/system/controlDict b/turek-hron-fsi3/fluid-openfoam/system/controlDict index 9ee3e3816..8be725212 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/controlDict +++ b/turek-hron-fsi3/fluid-openfoam/system/controlDict @@ -3,15 +3,11 @@ FoamFile version 2.0; format ascii; class dictionary; - location system; object controlDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Note: With OpenFOAM v1806 and OpenFOAM 6, the DyM solvers -// were marked deprecated and merged into their respective standard solvers. -application pimpleFoam; // OpenFOAM v1806, OpenFOAM 6, or newer -// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older +application pimpleFoam; // latest OpenFOAM +// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older libs ( "libgroovyBC.so" ) ; diff --git a/turek-hron-fsi3/fluid-openfoam/system/decomposeParDict b/turek-hron-fsi3/fluid-openfoam/system/decomposeParDict index 59d2ad529..a9e847699 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/decomposeParDict +++ b/turek-hron-fsi3/fluid-openfoam/system/decomposeParDict @@ -1,25 +1,23 @@ FoamFile { - version 2.0; - format ascii; - class dictionary; - location system; - object decomposeParDict; + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - numberOfSubdomains 25; - - method hierarchical; - hierarchicalCoeffs - { - n (5 5 1); - delta 0.001; - order xyz; - } - - distributed false; - roots - ( - ); +numberOfSubdomains 25; + +method hierarchical; +hierarchicalCoeffs +{ + n (5 5 1); + delta 0.001; + order xyz; +} + +distributed false; +roots +( +); diff --git a/turek-hron-fsi3/fluid-openfoam/system/fvSchemes b/turek-hron-fsi3/fluid-openfoam/system/fvSchemes index d95144988..dac95a86b 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/fvSchemes +++ b/turek-hron-fsi3/fluid-openfoam/system/fvSchemes @@ -3,39 +3,37 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSchemes; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - ddtSchemes - { - default backward; - } +ddtSchemes +{ + default backward; +} - gradSchemes - { - default cellLimited Gauss linear 1; - } +gradSchemes +{ + default cellLimited Gauss linear 1; +} - divSchemes - { - default none; - div(phi,U) Gauss linearUpwind grad(U); - div((nuEff*dev2(T(grad(U))))) Gauss linear; - } +divSchemes +{ + default none; + div(phi,U) Gauss linearUpwind grad(U); + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} - interpolationSchemes - { - default linear; - } +interpolationSchemes +{ + default linear; +} - laplacianSchemes - { - default Gauss linear corrected; - } +laplacianSchemes +{ + default Gauss linear corrected; +} - snGradSchemes - { - default corrected; - } +snGradSchemes +{ + default corrected; +} diff --git a/turek-hron-fsi3/fluid-openfoam/system/fvSolution b/turek-hron-fsi3/fluid-openfoam/system/fvSolution index d559f7d2f..2e9545709 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/fvSolution +++ b/turek-hron-fsi3/fluid-openfoam/system/fvSolution @@ -3,10 +3,8 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object fvSolution; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { @@ -88,8 +86,9 @@ PIMPLE } // OpenFOAM 6 (.org) or newer + // see also https://bugs.openfoam.org/view.php?id=3336 /* - residualControl + outerResidualControl { U 1e-5; p 1e-5; @@ -105,6 +104,3 @@ potentialFlow { nNonOrthogonalCorrectors 1; } - - -// ************************************************************************* // diff --git a/turek-hron-fsi3/fluid-openfoam/system/preciceDict b/turek-hron-fsi3/fluid-openfoam/system/preciceDict index 2b2f761ed..872566d38 100644 --- a/turek-hron-fsi3/fluid-openfoam/system/preciceDict +++ b/turek-hron-fsi3/fluid-openfoam/system/preciceDict @@ -3,7 +3,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "system"; object preciceDict; } diff --git a/volume-coupled-diffusion/README.md b/volume-coupled-diffusion/README.md new file mode 100644 index 000000000..28ec8f660 --- /dev/null +++ b/volume-coupled-diffusion/README.md @@ -0,0 +1,41 @@ +--- +title: Volume coupled diffusion +permalink: tutorials-volume-coupled-diffusion.html +keywords: FEniCS, Diffusion, Volume Coupling +summary: This tutorial illustrates volume coupling with a simple example. +--- + +{% include note.html content="Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/develop/volume-coupled-diffusion). Read how in the [tutorials introduction](https://precice.org/tutorials.html)." %} + +## Setup + +This case illustrates how to implement volume coupling in a simple toy problem. Two diffusion problems are coupled via volume terms. One domain (the source) has constant non-zero Dirichlet boundary conditions. The other domain (the drain) has Neumann boundary conditions and a zero Dirichlet boundary condition at the right edge of the domain. The quantity u flows from the source to the drain. + +![Case setup of volume-coupled-diffusion case](images/tutorials-volume-coupled-diffusion-setup.png) + +## Available solvers and dependencies + +* FEniCS. Install [FEniCS](https://fenicsproject.org/download/) and the [FEniCS-adapter](https://github.com/precice/fenics-adapter). Additionally, you will need to have preCICE and the python bindings installed on your system. + +## Running the simulation + +This tutorial is for FEniCS. You can find the corresponding `run.sh` script in the folder `fenics`. + +To choose whether you want to run the source or the drain solver, please provide the following command line input: + +* `-s` flag will create a source. +* `-d` flag will create a drain. + +For running the case, open two terminals run: + +```bash +cd fenics +./run.sh -s +``` + +and + +```bash +cd fenics +./run.sh -d +``` diff --git a/volume-coupled-diffusion/clean-tutorial.sh b/volume-coupled-diffusion/clean-tutorial.sh new file mode 120000 index 000000000..4713f5092 --- /dev/null +++ b/volume-coupled-diffusion/clean-tutorial.sh @@ -0,0 +1 @@ +../tools/clean-tutorial-base.sh \ No newline at end of file diff --git a/volume-coupled-diffusion/fenics/.gitignore b/volume-coupled-diffusion/fenics/.gitignore new file mode 100644 index 000000000..1c6ed0137 --- /dev/null +++ b/volume-coupled-diffusion/fenics/.gitignore @@ -0,0 +1,4 @@ +venv +*.pyc +*.log +out diff --git a/volume-coupled-diffusion/fenics/clean.sh b/volume-coupled-diffusion/fenics/clean.sh new file mode 100755 index 000000000..3a8b4619d --- /dev/null +++ b/volume-coupled-diffusion/fenics/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_fenics . diff --git a/volume-coupled-diffusion/fenics/precice-adapter-config-drain.json b/volume-coupled-diffusion/fenics/precice-adapter-config-drain.json new file mode 100644 index 000000000..a8a643e48 --- /dev/null +++ b/volume-coupled-diffusion/fenics/precice-adapter-config-drain.json @@ -0,0 +1,9 @@ +{ + "participant_name": "Drain", + "config_file_name": "../precice-config.xml", + "interface": { + "coupling_mesh_name": "Drain-Mesh", + "write_data_name": "Drain-Data", + "read_data_name": "Source-Data" + } +} diff --git a/volume-coupled-diffusion/fenics/precice-adapter-config-source.json b/volume-coupled-diffusion/fenics/precice-adapter-config-source.json new file mode 100644 index 000000000..04a0bce06 --- /dev/null +++ b/volume-coupled-diffusion/fenics/precice-adapter-config-source.json @@ -0,0 +1,9 @@ +{ + "participant_name": "Source", + "config_file_name": "../precice-config.xml", + "interface": { + "coupling_mesh_name": "Source-Mesh", + "write_data_name": "Source-Data", + "read_data_name": "Drain-Data" + } +} diff --git a/volume-coupled-diffusion/fenics/run.sh b/volume-coupled-diffusion/fenics/run.sh new file mode 100755 index 000000000..d15dd2163 --- /dev/null +++ b/volume-coupled-diffusion/fenics/run.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -e -u + +usage() { echo "Usage: cmd [-s] [-d]" 1>&2; exit 1; } + +# Check if no input argument was provided +if [ -z "$*" ] ; then + usage +fi + +# Select appropriate case +while getopts ":sd" opt; do + case ${opt} in + s) + python3 volume-coupled-diffusion.py --source + ;; + d) + python3 volume-coupled-diffusion.py --drain + ;; + *) + usage + ;; + esac +done diff --git a/volume-coupled-diffusion/fenics/volume-coupled-diffusion.py b/volume-coupled-diffusion/fenics/volume-coupled-diffusion.py new file mode 100644 index 000000000..eeffce490 --- /dev/null +++ b/volume-coupled-diffusion/fenics/volume-coupled-diffusion.py @@ -0,0 +1,131 @@ +from fenics import Function, FunctionSpace, Expression, Constant, DirichletBC, TrialFunction, TestFunction, File, \ + solve, lhs, rhs, dx, UnitSquareMesh, SubDomain, inner, grad, MeshFunction, MPI, interpolate +from fenicsprecice import Adapter +import numpy as np +import argparse + + +class AllDomain(SubDomain): + def inside(self, x, on_boundary): + return True + + +class AllBoundary(SubDomain): + def inside(self, x, on_boundary): + return on_boundary + + +class RightBoundary(SubDomain): + def inside(self, x, on_boundary): + return on_boundary and x[0] == 1 + + +parser = argparse.ArgumentParser(description="Solving a volume coupled problem") +command_group = parser.add_mutually_exclusive_group(required=True) +command_group.add_argument("-s", "--source", help="create a source", dest="source", action="store_true") +command_group.add_argument("-d", "--drain", help="create a drain", dest="drain", action="store_true") +args = parser.parse_args() + +if args.source: + precice = Adapter(adapter_config_filename="precice-adapter-config-source.json") +elif args.drain: + precice = Adapter(adapter_config_filename="precice-adapter-config-drain.json") + +mesh = UnitSquareMesh(10, 10) +V = FunctionSpace(mesh, "P", 1) + +u = TrialFunction(V) +v = TestFunction(V) +u_n = Function(V) +if args.source: + u_ini = Expression("1", degree=1) + bc = DirichletBC(V, u_ini, AllBoundary()) +elif args.drain: + u_ini = Expression("0", degree=1) + bc = DirichletBC(V, u_ini, RightBoundary()) + + +u_n = interpolate(u_ini, V) + + +dt = precice.initialize(AllDomain(), read_function_space=V, write_object=u_n) +volume_term = precice.create_coupling_expression() +f = Function(V) + + +dt_inv = Constant(1 / dt) + +diffusion_source = 1 +diffusion_drain = 1 +if args.source: + F = dt_inv * (u - u_n) * v * dx - (f - u_ini) * v * dx + diffusion_source * inner(grad(u), grad(v)) * dx +elif args.drain: + F = dt_inv * (u - u_n) * v * dx - (f - u) * v * dx + diffusion_drain * inner(grad(u), grad(v)) * dx + +# Time-stepping +u_np1 = Function(V) +if args.source: + u_n.rename("Source-Data", "") + u_np1.rename("Source-Data", "") +elif args.drain: + u_n.rename("Drain-Data", "") + u_np1.rename("Drain-Data", "") + +t = 0 + +mesh_rank = MeshFunction("size_t", mesh, mesh.topology().dim()) +if args.source: + mesh_rank.set_all(MPI.rank(MPI.comm_world) + 4) +else: + mesh_rank.set_all(MPI.rank(MPI.comm_world) + 0) +mesh_rank.rename("myRank", "") + +# Generating output files +solution_out = File("output/%s.pvd" % precice.get_participant_name()) +ranks = File("output/ranks%s.pvd" % precice.get_participant_name()) + +# output solution and reference solution at t=0, n=0 +n = 0 +print('output u^%d and u_ref^%d' % (n, n)) +solution_out << u_n +ranks << mesh_rank + +while precice.is_coupling_ongoing(): + + # write checkpoint + if precice.is_action_required(precice.action_write_iteration_checkpoint()): + precice.store_checkpoint(u_n, t, n) + + read_data = precice.read_data() + + # Update the coupling expression with the new read data + precice.update_coupling_expression(volume_term, read_data) + f.assign(interpolate(volume_term, V)) + + dt_inv.assign(1 / dt) + + # Compute solution u^n+1, use bcs u^n and coupling bcs + a, L = lhs(F), rhs(F) + solve(a == L, u_np1, bc) + + # Write data to preCICE according to which problem is being solved + precice.write_data(u_np1) + + dt = precice.advance(dt) + + # roll back to checkpoint + if precice.is_action_required(precice.action_read_iteration_checkpoint()): + u_cp, t_cp, n_cp = precice.retrieve_checkpoint() + u_n.assign(u_cp) + t = t_cp + n = n_cp + else: # update solution + u_n.assign(u_np1) + t += float(dt) + n += 1 + + if precice.is_time_window_complete(): + solution_out << u_n + +# Hold plot +precice.finalize() diff --git a/volume-coupled-diffusion/images/tutorials-volume-coupled-diffusion-setup.png b/volume-coupled-diffusion/images/tutorials-volume-coupled-diffusion-setup.png new file mode 100644 index 000000000..145d6282e Binary files /dev/null and b/volume-coupled-diffusion/images/tutorials-volume-coupled-diffusion-setup.png differ diff --git a/volume-coupled-diffusion/precice-config.xml b/volume-coupled-diffusion/precice-config.xml new file mode 100644 index 000000000..a8c7b7a6d --- /dev/null +++ b/volume-coupled-diffusion/precice-config.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +