diff --git a/partitioned-pipe/README.md b/partitioned-pipe/README.md new file mode 100644 index 000000000..a44faf549 --- /dev/null +++ b/partitioned-pipe/README.md @@ -0,0 +1,51 @@ +--- +title: Partitioned pipe flow +permalink: tutorials-partitioned-pipe.html +keywords: tutorial, FF, fluid-fluid coupling, OpenFOAM, pimpleFoam, sonicLiquidFoam +summary: This tutorial describes how to run a partitioned fluid simulation using preCICE. +--- + +{% include important.html content="We have not yet ported the documentation of the preCICE tutorials from the preCICE wiki to here. Please go to the [preCICE wiki](https://github.com/precice/precice/wiki#2-getting-started---tutorials)" %} + +## Setup + +This scenario consists of two pipes connected in series. A fluid enters from the left (here $$ z=0 $$) boundary of the Fluid1 participant with a uniform velocity profile ($$ u_{in} = 0.1 m/s $$) and zero pressure gradient. In its starting, uncoupled state, it exits from the right side (outlet: zero velocity gradient, zero pressure). This is also the coupling interface with Fluid2, which has the same boundary conditions as Fluid1. + +On the coupling interface, Fluid1 sends velocity and pressure gradient to Fluid2 and receives pressure. The additional pressure gradient exchange was found to help convergence [1], but this fluid-fluid coupling scenario is part of active research. + +## Available solvers + +Both for Fluid1 and Fluid2, the following participants are available: + +* OpenFOAM (pimpleFoam). An incompressible OpenFOAM solver. For more information, have a look at the [OpenFOAM adapter documentation](adapter-openfoam-overview.html). + +* OpenFOAM (sonicLiquidFoam). A compressible OpenFOAM solver. For more information, have a look at the [OpenFOAM adapter documentation](adapter-openfoam-overview.html). + +## Running the Simulation + +All listed solvers can be used in order to run the simulation. Open two separate terminals and start the desired fluid1 and fluid2 participants by calling the respective run script. For example: + +``` +cd fluid1-openfoam-pimplefoam +./run.sh +``` +and +``` +cd fluid2-openfoam-sonicliquidfoam +./run.sh +``` + +## Post-processing + +The OpenFOAM solvers generate a `.foam` file each. You can open this file in ParaView. +An example of the visualized expected results looks as follows: + +![result](images/tutorials-partitioned-pipe-results-pimpleFoam-sonicliquidfoam.png) + +Observe that the velocity and pressure values are smoothly changing around the coupling interface. The simulation starts with oscillations, which disappear after a few time steps. + +## References + +[1] G. Chourdakis, B. Uekermann, G. V. Zwieten, and H. V. Brummelen: [Coupling OpenFOAM to different solvers, physics, models, and dimensions using preCICE](https://mediatum.ub.tum.de/1515271), 14th OpenFOAM Workshop, Duisburg, Germany, submitted (proceedings publication delayed/cancelled), July 2019. + +{% include disclaimer.html content="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." %} diff --git a/partitioned-pipe/clean-tutorial.sh b/partitioned-pipe/clean-tutorial.sh new file mode 120000 index 000000000..4713f5092 --- /dev/null +++ b/partitioned-pipe/clean-tutorial.sh @@ -0,0 +1 @@ +../tools/clean-tutorial-base.sh \ No newline at end of file diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U new file mode 100644 index 000000000..fd165fe4e --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/U @@ -0,0 +1,30 @@ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0.1); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type fixedGradient; + gradient uniform (0 0 0); + } + fixedWalls + { + type noSlip; + } +} diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/0/p b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/p new file mode 100644 index 000000000..ada3a6d88 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/0/p @@ -0,0 +1,31 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedGradient; + gradient uniform 0; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + fixedWalls + { + type zeroGradient; + } +} diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/clean.sh b/partitioned-pipe/fluid1-openfoam-pimplefoam/clean.sh new file mode 100755 index 000000000..c31d9fc76 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties new file mode 100644 index 000000000..c055a4bfa --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/transportProperties @@ -0,0 +1,12 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e1; diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties new file mode 100644 index 000000000..2c55a8b28 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/constant/turbulenceProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} + +simulationType laminar; diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh new file mode 100755 index 000000000..7cadd6f3a --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +blockMesh +touch fluid1-openfoam-pimplefoam.foam + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict new file mode 100644 index 000000000..a2b080b83 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/blockMeshDict @@ -0,0 +1,104 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/polyMesh"; + object blockMeshDict; +} + +convertToMeters 1; + + +zmin 0; +zmax 20; + +xcells 10; // per block (5 blocks) +ycells 10; // per block (5 blocks) +zcells 20; + +vertices +( + (-3.535534 -3.535534 $zmin) // 0 + ( 3.535534 -3.535534 $zmin) // 1 + ( 3.535534 3.535534 $zmin) // 2 + (-3.535534 3.535534 $zmin) // 3 + (-1.414214 -1.414214 $zmin) // 4 + ( 1.414214 -1.414214 $zmin) // 5 + ( 1.414214 1.414214 $zmin) // 6 + (-1.414214 1.414214 $zmin) // 7 + + (-3.535534 -3.535534 $zmax) // 8 + ( 3.535534 -3.535534 $zmax) // 9 + ( 3.535534 3.535534 $zmax) // 10 + (-3.535534 3.535534 $zmax) // 11 + (-1.414214 -1.414214 $zmax) // 12 + ( 1.414214 -1.414214 $zmax) // 13 + ( 1.414214 1.414214 $zmax) // 14 + (-1.414214 1.414214 $zmax) // 15 +); + +blocks +( +hex (0 1 5 4 8 9 13 12) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (1 2 6 5 9 10 14 13) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (2 3 7 6 10 11 15 14) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (3 0 4 7 11 8 12 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (4 5 6 7 12 13 14 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +); + +edges +( +arc 0 1 ( 0 -5 $zmin) +arc 1 2 ( 5 0 $zmin) +arc 2 3 ( 0 5 $zmin) +arc 3 0 (-5 0 $zmin) +arc 4 5 ( 0 -1.5 $zmin) +arc 5 6 ( 1.5 0 $zmin) +arc 6 7 ( 0 1.5 $zmin) +arc 7 4 (-1.5 0 $zmin) + +arc 8 9 ( 0 -5 $zmax) +arc 9 10 ( 5 0 $zmax) +arc 10 11 ( 0 5 $zmax) +arc 11 8 (-5 0 $zmax) +arc 12 13 ( 0 -1.5 $zmax) +arc 13 14 (1.5 0 $zmax) +arc 14 15 ( 0 1.5 $zmax) +arc 15 12 (-1.5 0 $zmax) +); + + +patches +( + + patch fixedWalls + ( + (0 1 9 8) + (1 2 10 9) + (2 3 11 10) + (3 0 8 11) + ) + + patch inlet + ( + (0 1 5 4) + (1 2 6 5) + (2 3 7 6) + (3 0 4 7) + (4 5 6 7) + ) + + patch outlet + ( + (8 9 13 12) + (9 10 14 13) + (10 11 15 14) + (12 13 14 15) + (11 8 12 15) + ) +); + +mergePatchPairs +( +); diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict new file mode 100644 index 000000000..9fe0ab9f5 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/controlDict @@ -0,0 +1,45 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10.0; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/decomposeParDict new file mode 100644 index 000000000..ad99cf6c5 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/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-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes new file mode 100644 index 000000000..a22010ae4 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSchemes @@ -0,0 +1,40 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss upwind; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSolution b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSolution new file mode 100644 index 000000000..7e4fe2724 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/fvSolution @@ -0,0 +1,74 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} + +solvers +{ + + p + { + + solver PCG; + preconditioner DIC; + tolerance 1e-8; + relTol 1.0e-3; + } + + pFinal + { + $p; + relTol 0; + } + + pcorr + { + $p; + } + + pcorrFinal + { + $pcorr; + relTol 0; + } + + Phi + { + $p; + } + + "(U|cellDisplacement)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 1e-4; + minIter 2; + } + + "(U|cellDisplacement)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 4; + nNonOrthogonalCorrectors 1; + consistent true; + correctPhi true; + momentumPredictor true; + nOuterCorrectors 1; +} + + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict new file mode 100644 index 000000000..b496662d1 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/system/preciceDict @@ -0,0 +1,34 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Fluid1; + +modules (FF); + +interfaces +{ + Interface1 + { + mesh Fluid1-Mesh; + patches (outlet); + + readData + ( + Pressure + ); + + writeData + ( + Velocity + 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 new file mode 100644 index 000000000..fd165fe4e --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/U @@ -0,0 +1,30 @@ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0.1); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type fixedGradient; + gradient uniform (0 0 0); + } + fixedWalls + { + type noSlip; + } +} diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/p b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/p new file mode 100644 index 000000000..eefaf12bd --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/0/p @@ -0,0 +1,31 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedGradient; + gradient uniform 0; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + fixedWalls + { + type zeroGradient; + } +} diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/clean.sh b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/clean.sh new file mode 100755 index 000000000..c31d9fc76 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties new file mode 100644 index 000000000..6bc1693b3 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/thermodynamicProperties @@ -0,0 +1,14 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermodynamicProperties; +} + +rho0 rho0 [1 -3 0 0 0 0 0] 1; + +p0 p0 [1 -1 -2 0 0 0 0] 100000; + +psi psi [0 -2 2 0 0 0 0] 4.54e-07; diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties new file mode 100644 index 000000000..0f39f4183 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/transportProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} + +mu mu [1 -1 -1 0 0 0 0] 1e1; diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties new file mode 100644 index 000000000..2c55a8b28 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/constant/turbulenceProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} + +simulationType laminar; diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh new file mode 100755 index 000000000..76e94cbc8 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +blockMesh +touch fluid1-openfoam-sonicliquidfoam.foam + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict new file mode 100644 index 000000000..a2b080b83 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/blockMeshDict @@ -0,0 +1,104 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/polyMesh"; + object blockMeshDict; +} + +convertToMeters 1; + + +zmin 0; +zmax 20; + +xcells 10; // per block (5 blocks) +ycells 10; // per block (5 blocks) +zcells 20; + +vertices +( + (-3.535534 -3.535534 $zmin) // 0 + ( 3.535534 -3.535534 $zmin) // 1 + ( 3.535534 3.535534 $zmin) // 2 + (-3.535534 3.535534 $zmin) // 3 + (-1.414214 -1.414214 $zmin) // 4 + ( 1.414214 -1.414214 $zmin) // 5 + ( 1.414214 1.414214 $zmin) // 6 + (-1.414214 1.414214 $zmin) // 7 + + (-3.535534 -3.535534 $zmax) // 8 + ( 3.535534 -3.535534 $zmax) // 9 + ( 3.535534 3.535534 $zmax) // 10 + (-3.535534 3.535534 $zmax) // 11 + (-1.414214 -1.414214 $zmax) // 12 + ( 1.414214 -1.414214 $zmax) // 13 + ( 1.414214 1.414214 $zmax) // 14 + (-1.414214 1.414214 $zmax) // 15 +); + +blocks +( +hex (0 1 5 4 8 9 13 12) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (1 2 6 5 9 10 14 13) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (2 3 7 6 10 11 15 14) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (3 0 4 7 11 8 12 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (4 5 6 7 12 13 14 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +); + +edges +( +arc 0 1 ( 0 -5 $zmin) +arc 1 2 ( 5 0 $zmin) +arc 2 3 ( 0 5 $zmin) +arc 3 0 (-5 0 $zmin) +arc 4 5 ( 0 -1.5 $zmin) +arc 5 6 ( 1.5 0 $zmin) +arc 6 7 ( 0 1.5 $zmin) +arc 7 4 (-1.5 0 $zmin) + +arc 8 9 ( 0 -5 $zmax) +arc 9 10 ( 5 0 $zmax) +arc 10 11 ( 0 5 $zmax) +arc 11 8 (-5 0 $zmax) +arc 12 13 ( 0 -1.5 $zmax) +arc 13 14 (1.5 0 $zmax) +arc 14 15 ( 0 1.5 $zmax) +arc 15 12 (-1.5 0 $zmax) +); + + +patches +( + + patch fixedWalls + ( + (0 1 9 8) + (1 2 10 9) + (2 3 11 10) + (3 0 8 11) + ) + + patch inlet + ( + (0 1 5 4) + (1 2 6 5) + (2 3 7 6) + (3 0 4 7) + (4 5 6 7) + ) + + patch outlet + ( + (8 9 13 12) + (9 10 14 13) + (10 11 15 14) + (12 13 14 15) + (11 8 12 15) + ) +); + +mergePatchPairs +( +); diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict new file mode 100644 index 000000000..162aef6ed --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/controlDict @@ -0,0 +1,45 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} + +application sonicLiquidFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10.0; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/decomposeParDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/decomposeParDict new file mode 100644 index 000000000..ad99cf6c5 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/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-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes new file mode 100644 index 000000000..edf56a6dc --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSchemes @@ -0,0 +1,40 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} + +ddtSchemes +{ + default CrankNicolson 0.45; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phid,p) Gauss limitedLinear 1; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution new file mode 100644 index 000000000..506c2ecf8 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/fvSolution @@ -0,0 +1,43 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} + +solvers +{ + "p.*" + { + solver PBiCG; + preconditioner DILU + tolerance 1e-06; + relTol 0.01; + } + + "U.*" + { + $p; + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "rho.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-05; + relTol 0.1; + } +} + +PIMPLE +{ + nOuterCorrectors 4; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict new file mode 100644 index 000000000..b496662d1 --- /dev/null +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/system/preciceDict @@ -0,0 +1,34 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Fluid1; + +modules (FF); + +interfaces +{ + Interface1 + { + mesh Fluid1-Mesh; + patches (outlet); + + readData + ( + Pressure + ); + + writeData + ( + Velocity + 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 new file mode 100644 index 000000000..94afa03ee --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/0/U @@ -0,0 +1,30 @@ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type fixedGradient; + gradient uniform (0 0 0); + } + fixedWalls + { + type noSlip; + } +} diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/0/p b/partitioned-pipe/fluid2-openfoam-pimplefoam/0/p new file mode 100644 index 000000000..ada3a6d88 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/0/p @@ -0,0 +1,31 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedGradient; + gradient uniform 0; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + fixedWalls + { + type zeroGradient; + } +} diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/clean.sh b/partitioned-pipe/fluid2-openfoam-pimplefoam/clean.sh new file mode 100755 index 000000000..c31d9fc76 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties new file mode 100644 index 000000000..c055a4bfa --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/transportProperties @@ -0,0 +1,12 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e1; diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties new file mode 100644 index 000000000..2c55a8b28 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/constant/turbulenceProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} + +simulationType laminar; diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh new file mode 100755 index 000000000..d00617f49 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +blockMesh +touch fluid2-openfoam-pimplefoam.foam + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/blockMeshDict b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/blockMeshDict new file mode 100644 index 000000000..56363d94b --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/blockMeshDict @@ -0,0 +1,104 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/polyMesh"; + object blockMeshDict; +} + +convertToMeters 1; + + +zmin 20; +zmax 40; + +xcells 10; // per block (5 blocks) +ycells 10; // per block (5 blocks) +zcells 20; + +vertices +( + (-3.535534 -3.535534 $zmin) // 0 + ( 3.535534 -3.535534 $zmin) // 1 + ( 3.535534 3.535534 $zmin) // 2 + (-3.535534 3.535534 $zmin) // 3 + (-1.414214 -1.414214 $zmin) // 4 + ( 1.414214 -1.414214 $zmin) // 5 + ( 1.414214 1.414214 $zmin) // 6 + (-1.414214 1.414214 $zmin) // 7 + + (-3.535534 -3.535534 $zmax) // 8 + ( 3.535534 -3.535534 $zmax) // 9 + ( 3.535534 3.535534 $zmax) // 10 + (-3.535534 3.535534 $zmax) // 11 + (-1.414214 -1.414214 $zmax) // 12 + ( 1.414214 -1.414214 $zmax) // 13 + ( 1.414214 1.414214 $zmax) // 14 + (-1.414214 1.414214 $zmax) // 15 +); + +blocks +( +hex (0 1 5 4 8 9 13 12) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (1 2 6 5 9 10 14 13) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (2 3 7 6 10 11 15 14) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (3 0 4 7 11 8 12 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (4 5 6 7 12 13 14 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +); + +edges +( +arc 0 1 ( 0 -5 $zmin) +arc 1 2 ( 5 0 $zmin) +arc 2 3 ( 0 5 $zmin) +arc 3 0 (-5 0 $zmin) +arc 4 5 ( 0 -1.5 $zmin) +arc 5 6 ( 1.5 0 $zmin) +arc 6 7 ( 0 1.5 $zmin) +arc 7 4 (-1.5 0 $zmin) + +arc 8 9 ( 0 -5 $zmax) +arc 9 10 ( 5 0 $zmax) +arc 10 11 ( 0 5 $zmax) +arc 11 8 (-5 0 $zmax) +arc 12 13 ( 0 -1.5 $zmax) +arc 13 14 (1.5 0 $zmax) +arc 14 15 ( 0 1.5 $zmax) +arc 15 12 (-1.5 0 $zmax) +); + + +patches +( + + patch fixedWalls + ( + (0 1 9 8) + (1 2 10 9) + (2 3 11 10) + (3 0 8 11) + ) + + patch inlet + ( + (0 1 5 4) + (1 2 6 5) + (2 3 7 6) + (3 0 4 7) + (4 5 6 7) + ) + + patch outlet + ( + (8 9 13 12) + (9 10 14 13) + (10 11 15 14) + (12 13 14 15) + (11 8 12 15) + ) +); + +mergePatchPairs +( +); diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict new file mode 100644 index 000000000..9fe0ab9f5 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/controlDict @@ -0,0 +1,45 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10.0; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/decomposeParDict b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/decomposeParDict new file mode 100644 index 000000000..ad99cf6c5 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/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-pipe/fluid2-openfoam-pimplefoam/system/fvSchemes b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/fvSchemes new file mode 100644 index 000000000..a22010ae4 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/fvSchemes @@ -0,0 +1,40 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss upwind; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/fvSolution b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/fvSolution new file mode 100644 index 000000000..7e4fe2724 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/fvSolution @@ -0,0 +1,74 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} + +solvers +{ + + p + { + + solver PCG; + preconditioner DIC; + tolerance 1e-8; + relTol 1.0e-3; + } + + pFinal + { + $p; + relTol 0; + } + + pcorr + { + $p; + } + + pcorrFinal + { + $pcorr; + relTol 0; + } + + Phi + { + $p; + } + + "(U|cellDisplacement)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 1e-4; + minIter 2; + } + + "(U|cellDisplacement)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 4; + nNonOrthogonalCorrectors 1; + consistent true; + correctPhi true; + momentumPredictor true; + nOuterCorrectors 1; +} + + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/system/preciceDict b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/preciceDict new file mode 100644 index 000000000..f17b23d93 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/system/preciceDict @@ -0,0 +1,34 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Fluid2; + +modules (FF); + +interfaces +{ + Interface1 + { + mesh Fluid2-Mesh; + patches (inlet); + + readData + ( + Velocity + PressureGradient + ); + + writeData + ( + Pressure + ); + }; +}; \ No newline at end of file diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U new file mode 100644 index 000000000..94afa03ee --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/U @@ -0,0 +1,30 @@ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type fixedGradient; + gradient uniform (0 0 0); + } + fixedWalls + { + type noSlip; + } +} diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/p b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/p new file mode 100644 index 000000000..eefaf12bd --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/0/p @@ -0,0 +1,31 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedGradient; + gradient uniform 0; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + fixedWalls + { + type zeroGradient; + } +} diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/clean.sh b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/clean.sh new file mode 100755 index 000000000..c31d9fc76 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e -u + +. ../../tools/cleaning-tools.sh + +clean_openfoam . diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties new file mode 100644 index 000000000..aa3c63f53 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/thermodynamicProperties @@ -0,0 +1,15 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermodynamicProperties; +} + +rho0 rho0 [1 -3 0 0 0 0 0] 1; + +p0 p0 [1 -1 -2 0 0 0 0] 100000; + +psi psi [0 -2 2 0 0 0 0] 4.54e-07; + diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties new file mode 100644 index 000000000..0f39f4183 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/transportProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} + +mu mu [1 -1 -1 0 0 0 0] 1e1; diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties new file mode 100644 index 000000000..2c55a8b28 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/constant/turbulenceProperties @@ -0,0 +1,10 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} + +simulationType laminar; diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh new file mode 100755 index 000000000..5a24175c5 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e -u + +blockMesh +touch fluid2-openfoam-sonicliquidfoam.foam + +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict new file mode 100644 index 000000000..56363d94b --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/blockMeshDict @@ -0,0 +1,104 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/polyMesh"; + object blockMeshDict; +} + +convertToMeters 1; + + +zmin 20; +zmax 40; + +xcells 10; // per block (5 blocks) +ycells 10; // per block (5 blocks) +zcells 20; + +vertices +( + (-3.535534 -3.535534 $zmin) // 0 + ( 3.535534 -3.535534 $zmin) // 1 + ( 3.535534 3.535534 $zmin) // 2 + (-3.535534 3.535534 $zmin) // 3 + (-1.414214 -1.414214 $zmin) // 4 + ( 1.414214 -1.414214 $zmin) // 5 + ( 1.414214 1.414214 $zmin) // 6 + (-1.414214 1.414214 $zmin) // 7 + + (-3.535534 -3.535534 $zmax) // 8 + ( 3.535534 -3.535534 $zmax) // 9 + ( 3.535534 3.535534 $zmax) // 10 + (-3.535534 3.535534 $zmax) // 11 + (-1.414214 -1.414214 $zmax) // 12 + ( 1.414214 -1.414214 $zmax) // 13 + ( 1.414214 1.414214 $zmax) // 14 + (-1.414214 1.414214 $zmax) // 15 +); + +blocks +( +hex (0 1 5 4 8 9 13 12) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (1 2 6 5 9 10 14 13) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (2 3 7 6 10 11 15 14) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (3 0 4 7 11 8 12 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +hex (4 5 6 7 12 13 14 15) pipe ($xcells $ycells $zcells) edgeGrading (1 1 1 1 1 1 1 1 1 1 1 1) +); + +edges +( +arc 0 1 ( 0 -5 $zmin) +arc 1 2 ( 5 0 $zmin) +arc 2 3 ( 0 5 $zmin) +arc 3 0 (-5 0 $zmin) +arc 4 5 ( 0 -1.5 $zmin) +arc 5 6 ( 1.5 0 $zmin) +arc 6 7 ( 0 1.5 $zmin) +arc 7 4 (-1.5 0 $zmin) + +arc 8 9 ( 0 -5 $zmax) +arc 9 10 ( 5 0 $zmax) +arc 10 11 ( 0 5 $zmax) +arc 11 8 (-5 0 $zmax) +arc 12 13 ( 0 -1.5 $zmax) +arc 13 14 (1.5 0 $zmax) +arc 14 15 ( 0 1.5 $zmax) +arc 15 12 (-1.5 0 $zmax) +); + + +patches +( + + patch fixedWalls + ( + (0 1 9 8) + (1 2 10 9) + (2 3 11 10) + (3 0 8 11) + ) + + patch inlet + ( + (0 1 5 4) + (1 2 6 5) + (2 3 7 6) + (3 0 4 7) + (4 5 6 7) + ) + + patch outlet + ( + (8 9 13 12) + (9 10 14 13) + (10 11 15 14) + (12 13 14 15) + (11 8 12 15) + ) +); + +mergePatchPairs +( +); diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict new file mode 100644 index 000000000..162aef6ed --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/controlDict @@ -0,0 +1,45 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} + +application sonicLiquidFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10.0; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +functions +{ + preCICE_Adapter + { + type preciceAdapterFunctionObject; + libs ("libpreciceAdapterFunctionObject.so"); + } +} diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/decomposeParDict new file mode 100644 index 000000000..ad99cf6c5 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/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-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes new file mode 100644 index 000000000..edf56a6dc --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSchemes @@ -0,0 +1,40 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} + +ddtSchemes +{ + default CrankNicolson 0.45; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phid,p) Gauss limitedLinear 1; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution new file mode 100644 index 000000000..506c2ecf8 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/fvSolution @@ -0,0 +1,43 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} + +solvers +{ + "p.*" + { + solver PBiCG; + preconditioner DILU + tolerance 1e-06; + relTol 0.01; + } + + "U.*" + { + $p; + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "rho.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-05; + relTol 0.1; + } +} + +PIMPLE +{ + nOuterCorrectors 4; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict new file mode 100644 index 000000000..f17b23d93 --- /dev/null +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/system/preciceDict @@ -0,0 +1,34 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object preciceDict; +} + +preciceConfig "../precice-config.xml"; + +participant Fluid2; + +modules (FF); + +interfaces +{ + Interface1 + { + mesh Fluid2-Mesh; + patches (inlet); + + readData + ( + Velocity + PressureGradient + ); + + writeData + ( + Pressure + ); + }; +}; \ No newline at end of file diff --git a/partitioned-pipe/images/tutorials-partitioned-pipe-results-pimpleFoam-sonicliquidfoam.png b/partitioned-pipe/images/tutorials-partitioned-pipe-results-pimpleFoam-sonicliquidfoam.png new file mode 100644 index 000000000..919d5193f Binary files /dev/null and b/partitioned-pipe/images/tutorials-partitioned-pipe-results-pimpleFoam-sonicliquidfoam.png differ diff --git a/partitioned-pipe/precice-config.xml b/partitioned-pipe/precice-config.xml new file mode 100644 index 000000000..1a8cf842f --- /dev/null +++ b/partitioned-pipe/precice-config.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/cleaning-tools.sh b/tools/cleaning-tools.sh index d85505fff..692affc8a 100755 --- a/tools/cleaning-tools.sh +++ b/tools/cleaning-tools.sh @@ -97,6 +97,7 @@ clean_openfoam() { # shellcheck disable=SC1090 # This is an OpenFOAM file which we don't need to check . "${WM_PROJECT_DIR}/bin/tools/CleanFunctions" cleanCase + rm -rfv 0/uniform/functionObjects/functionObjectProperties fi clean_precice_logs . )