-
-
Notifications
You must be signed in to change notification settings - Fork 164
Add flow-over-heated-plate-particles tutorial #834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mike-tree-corvid
wants to merge
14
commits into
precice:develop
Choose a base branch
from
mike-tree-corvid:flow-over-heated-plate-lagrangian-particles
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d462aff
add flow-over-heated-plate/fluid-openfoam-basicReactingMultiphaseClou…
d0ff8da
change controlDict to use refactored lib file "libimplicitInjectors.s…
942f9cd
reformat flow-over-heated-plate/fluid-openfoam-basicReactingMultiphas…
b73e2f4
update tools/openfoam-remove-empty-dirs.sh to support processor* dirs,
4ed4683
moved images dir location and added metadata.yaml
ca7e9d2
added 834.md to changelog-entries summarizing user-facing changes
f892578
removed OpenFOAM header from solid-openfoam/0/T file
ab88492
replace temperature_with_particles.gif with coarser .gif so it takes …
5db2025
removed temperature_with_particles.pvsm from flow-over-heated-plate-p…
54af0ff
Merge branch 'develop' into flow-over-heated-plate-lagrangian-particles
MakisH 2534244
Fix image names
MakisH 840d836
Remove remaining OpenFOAM comment headers and separators
MakisH fe004fb
Make solid-openfoam directories identical
MakisH 42391c1
Port latest changes to the fluid-openfoam/clean.sh script
MakisH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Added a flow over heated plate tutorial with particles that employs implicit coupling using the OpenFOAM adapter [#834](https://github.com/precice/tutorials/pull/834) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: Flow over heated plate with particles | ||
| permalink: tutorials-flow-over-heated-plate-particles.html | ||
| keywords: tutorial, CHT, conjugate-heat transfer, OpenFOAM, Lagrangian particles, implicit coupling | ||
| summary: This tutorial describes how to run a conjugate heat transfer coupled simulation including Lagrangian particles using preCICE. This tutorial acts as verification for adding support for implicit coupling of Lagrangian particles to the OpenFOAM preCICE adapter. OpenFOAM is used as both the fluid (including particles) and solid solver. | ||
| --- | ||
|
|
||
| {% note %} | ||
| Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/develop/flow-over-heated-plate-particles), as continuously rendered here, or see the [latest released version](https://github.com/precice/tutorials/tree/master/flow-over-heated-plate-particles) (if there is already one). Read how in the [tutorials introduction](https://precice.org/tutorials.html). | ||
| {% endnote %} | ||
|
|
||
| ## Setup | ||
|
|
||
| This scenario consists of one fluid and one solid participant and it is inspired by Vynnycky et al. [1]. A fluid enters a channel with temperature $$ T_\infty $$, where it comes in contact with a solid plate. The plate is heated at its bottom and has a constant temperature of $$ T_{hot} $$. The scenario differs from the flow-over-heated-plate tutorial by adding a basicReactingCloud of particles to the fluid (OpenFOAM) participant. | ||
|
|
||
|  | ||
|
|
||
| The test case is two-dimensional and a serial-implicit coupling with Aitken underrelaxation is used for the coupling. | ||
|
|
||
| Proper implicit coupling of Lagrangian particles involves not only accounting for existing particles in the domain during checkpointing, but also adjusting the particle injection logic for implicit coupling loops within time-windows as well. Particle injection is handled in OpenFOAM via injectionModels. injectionModels lie outside the OpenFOAM solver objectRegistry, so they cannot be directly modified by the existing OpenFOAM preCICE adapter functionObject. Therefore, the OpenFOAM preCICE adapter source code was modified to build an additional library, `libImplicitInjectors.so`. `libImplicitInjectors.so` contains "implicit" versions of the following existing OpenFOAM-native injectionModel types: patchInjection, coneNozzleInjection, and manualInjection. In practice, the user simply needs to make sure they have the `libImplicitInjectors.so` library loaded in their `system/ControlDict` file (alongside `libpreciceAdapterFunctionObject.so`) and then swap a native OpenFOAM injectionModel type (like patchInjection) for an "implicit" version (implicitPatchInjection) in the injectionModels sub-dictionary of their particle cloud file. The following table maps native OpenFOAM injectionModels to their corresponding "implicit" version: | ||
|
|
||
| | Native OpenFOAM | "implicit" verison | | ||
| | --------------- | ------------------ | | ||
| | patchInjection | implicitPatchInjection | | ||
| | coneNozzleInjection | implicitConeNozzleInjection | | ||
| | manualInjection | implicitManualInjection | | ||
|
|
||
| The inlet velocity is $$ u_{\infty} = 0.1 m/s $$, the inlet temperature is $$ T_{\infty} = 300K $$. The fluid and solid have the same thermal conductivities $$ k_S = k_F = 100 W/m/K $$. Further material properties of the fluid are its viscosity $$ \mu = 0.0002 kg/m/s $$ and specific heat capacity $$ c_p = 5000 J/kg/K $$. The Prandtl number $$ Pr = 0.01 $$ follows from thermal conductivity, viscosity and specific heat capacity. The solid has the thermal diffusivity $$ \alpha = 1 m^2/s $$. The gravitational acceleration is $$ g = 9.81 m/s^2 $$. | ||
|
|
||
| Particle properties were set to match the fluid: $$ rho = 1.0 kg/m^3 $$, $$ c_p = 5000 J/kg/K $$, $$ T_0 = 300 K $$, $$ U_0 = (0.4 0 0) m/s $$. | ||
|
|
||
| ## Configuration | ||
|
|
||
| preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)): | ||
|
|
||
|  | ||
|
|
||
| ## Available solvers | ||
|
|
||
| By default, the fluid participant reads heat-flux values and the solid participant reads temperature values for the coupled simulation. The following participants are available: | ||
|
|
||
| Fluid participant: | ||
|
|
||
| * OpenFOAM (buoyantPimpleFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html). | ||
|
|
||
| Solid participant: | ||
|
|
||
| * OpenFOAM (laplacianFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/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 fluid and solid participant by calling the respective run script `run.sh` located in the participant directory. For example: | ||
|
|
||
| ```bash | ||
| cd fluid-openfoam | ||
| ./run.sh | ||
| ``` | ||
|
|
||
| and | ||
|
|
||
| ```bash | ||
| cd solid-openfoam | ||
| ./run.sh | ||
| ``` | ||
|
|
||
| ## Post-processing | ||
|
|
||
| How to visualize the simulation results depends on the selected solvers. Most of the solvers generate VTK files which can visualized using ParaView or similar tools. | ||
| In case of OpenFOAM, you can open the `.foam` file with ParaView, or create VTK files with `foamToVTK`. | ||
|
|
||
| An example of the visualized expected results looks as follows: | ||
|
|
||
|  | ||
|
|
||
| ## References | ||
|
|
||
| [1] M. Vynnycky, S. Kimura, K. Kanev, and I. Pop. Forced convection heat transfer from a flat plate: the conjugate problem. International Journal of Heat and Mass Transfer, 41(1):45 – 59, 1998. | ||
|
|
||
| {% 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 %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../tools/clean-tutorial-base.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object T; | ||
| } | ||
|
|
||
| dimensions [ 0 0 0 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 1.0; | ||
|
|
||
| boundaryField | ||
| { | ||
| ".*" | ||
| { | ||
| type fixedValue; | ||
| value uniform 1.0; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object T; | ||
| } | ||
|
|
||
| dimensions [ 0 0 0 1 0 0 0 ]; | ||
|
|
||
| internalField uniform 300; | ||
|
|
||
| boundaryField | ||
| { | ||
| interface | ||
| { | ||
| type fixedGradient; | ||
| gradient uniform 0; | ||
| } | ||
| inlet | ||
| { | ||
| type fixedValue; | ||
| value $internalField; | ||
| } | ||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| top | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| bottom | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| slip-bottom | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| outerWall | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volVectorField; | ||
| object U; | ||
| } | ||
|
|
||
| dimensions [ 0 1 -1 0 0 0 0 ]; | ||
|
|
||
| internalField uniform ( 0.1 0 0 ); | ||
|
|
||
| boundaryField | ||
| { | ||
| interface | ||
| { | ||
| type noSlip; | ||
| } | ||
| inlet | ||
| { | ||
| type fixedValue; | ||
| value $internalField; | ||
| } | ||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| top | ||
| { | ||
| type slip; | ||
| } | ||
| bottom | ||
| { | ||
| type noSlip; | ||
| } | ||
| slip-bottom | ||
| { | ||
| type slip; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object alphat; | ||
| } | ||
|
|
||
| dimensions [ 1 -1 -1 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0; | ||
|
|
||
| boundaryField | ||
| { | ||
| interface | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| inlet | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| outlet | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| top | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| bottom | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| slip-bottom | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object epsilon; | ||
| } | ||
|
|
||
| dimensions [ 0 2 -3 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0.01; | ||
|
|
||
| boundaryField | ||
| { | ||
| interface | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| inlet | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| outlet | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| top | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| bottom | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| slip-bottom | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object k; | ||
| } | ||
|
|
||
| dimensions [ 0 2 -2 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0.1; | ||
|
|
||
| boundaryField | ||
| { | ||
| interface | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| inlet | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| outlet | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| top | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| slip-bottom | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| bottom | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads a bit like a pull request description. Assuming that the feature would be merged in the OpenFOAM adapter, this could be written from the perspective of "this type of OpenFOAM simulation works as well".
Some of this information (including the table) could go into the feature
README.md(see adapter PR) and/or to the adapter documentation.But these are details that I could also directly sort out at the end of the review.