-
-
Notifications
You must be signed in to change notification settings - Fork 164
Volume-coupled flow tutorial #350
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
2332c5e
basics for new tutorial
tirgendetwas ee4f21e
fix blockMestDict
tirgendetwas 178b4a7
basic components
tirgendetwas 469470f
grading attempt
tirgendetwas 73cc999
making it run and refining grading
tirgendetwas 9073ead
attempt to use phi
tirgendetwas 56ba21f
fix write interval and simplify configuration
tirgendetwas a42837f
cleanup and reveret
tirgendetwas cb94d9c
cleanup
tirgendetwas 45b1a33
gitignore and delete IDE files
tirgendetwas f9a8680
feedback and switch mapping
tirgendetwas 9f73a63
update README
tirgendetwas 738e969
clean up
tirgendetwas 03bb6cd
update mapping in config
tirgendetwas 02fcc1c
make fluid mesh in openfoam the same size as fluid nutils
tirgendetwas e5b3bb4
porting to v3 in nutils participants
tirgendetwas a0c41f1
correct timestepping
tirgendetwas 5f6e024
formatting
tirgendetwas 45fdfb5
apply feedback from other branch to this branch
tirgendetwas 8b0a326
groundwork
tirgendetwas bd81e41
tutorial before adding zones (not working)
tirgendetwas 6fb10ca
attempt to fix (not working)
tirgendetwas bd956c5
fix config
tirgendetwas b504290
update microwave tutorial with two cellSets
tirgendetwas 5f4fd88
adjust dummy solver and tutorial to reading Velocity
tirgendetwas 3c3f88e
cleanup and renaming dummy solver
tirgendetwas b828bd3
renaming
tirgendetwas 6417966
delete old tutorial
tirgendetwas 2c734b2
clean up
tirgendetwas 9a8ccb1
formatting
tirgendetwas c1e5e1c
port from v2 to v3
tirgendetwas 6e8d30e
cleanup forgotten files
tirgendetwas 4c8ee96
apply feedback
tirgendetwas 9b78d54
README for tutorial case
tirgendetwas 7d5c836
small fix
tirgendetwas 0310219
linting errors
tirgendetwas 8904b51
attempt to fix error
tirgendetwas aab43bb
Merge branch 'develop' into volume_coupled_flow
MakisH 17d9775
Revert channel-transport mapping to RBF
MakisH 75d8462
Add dimensions to meshes
MakisH e44cb1c
change README tutorial link
tirgendetwas a52f774
Rename dummy to source
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,65 @@ | ||
| --- | ||
| title: Volume-coupled flow | ||
| permalink: tutorials-volume-coupled-flow.html | ||
| keywords: volume coupling, OpenFOAM, source terms | ||
| summary: A dummy source participant is coupled to a fluid in a uni-directional way over a region of the domain. The coupling enforces source terms on that region. | ||
| --- | ||
|
|
||
| {% note %} | ||
| Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/volume-coupled-flow). Read how in the [tutorials introduction](https://www.precice.org/tutorials.html). | ||
| {% endnote %} | ||
|
|
||
| ## Setup | ||
|
|
||
| We introduce flow into a fluid through a square-shaped source located between $$ (3.0, 1.0) $$ and $$ (3.5, 1.5) $$. The velocity at the source is constant in the x component $$ (U.x() = 10.0) $$. | ||
|
|
||
| The state of the $$ U.x() $$ of the fluid at $$ t = 0.5s $$ (the source region is highlighted): | ||
|
|
||
|  | ||
|
|
||
| This case is a convenient starting point for volume coupling where OpenFOAM is a reading participant. The writing Nutils participant (dummy source) can be replaced by a more complex solver according to the user's needs. | ||
|
|
||
| ## Available solvers | ||
|
|
||
| Fluid participant: | ||
|
|
||
| * OpenFOAM (buoyantPimpleFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html). | ||
|
|
||
| Source participant: | ||
|
|
||
| * 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 v7.0. | ||
|
|
||
| ## Running the simulation | ||
|
|
||
| Open two separate terminals and start the participants by calling the respective run scripts `run.sh` located in each of the participants' directory. For example: | ||
|
|
||
| ```bash | ||
| cd fluid-openfoam | ||
| ./run.sh | ||
| ``` | ||
|
|
||
| and | ||
|
|
||
| ```bash | ||
| cd source-nutils | ||
| ./run.sh | ||
| ``` | ||
|
|
||
| ## Post-processing | ||
|
|
||
| The fluid participants generates a `.foam` file which can be visualized using, e.g., ParaView. | ||
|
|
||
| ## Notes on the configuration | ||
|
|
||
| This case uses OpenFOAM's `fvOptions` to enforce source terms. Additionally, the coupled variable `U` needs to be given an alternative name in order for this to work: | ||
|
|
||
| ```C++ | ||
| FF | ||
| { | ||
| nameU U_vol; | ||
| }; | ||
| ``` | ||
|
|
||
| Since OpenFOAM already uses `U`, we need to create an additional velocity variable to use specifically for the coupling. That allows us to carry the desired value over to OpenFOAM and apply it at the correct moment in the iteration. A simplified view of the workflow: | ||
|
|
||
|  |
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,40 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object T; | ||
| } | ||
|
|
||
| dimensions [ 0 0 0 1 0 0 0 ]; | ||
|
|
||
| internalField uniform 300; | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type fixedValue; | ||
| value $internalField; | ||
| } | ||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| upperWall | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| lowerWall | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,40 @@ | ||
| 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 | ||
| { | ||
| inlet | ||
| { | ||
| type fixedValue; | ||
| value $internalField; | ||
| } | ||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| upperWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| lowerWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,40 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volVectorField; | ||
| object U_vol; | ||
| } | ||
|
|
||
| dimensions [ 0 1 -1 0 0 0 0 ]; | ||
|
|
||
| internalField uniform ( 0.1 0 0 ); | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type fixedValue; | ||
| value $internalField; | ||
| } | ||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| upperWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| lowerWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,43 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object alphat; | ||
| } | ||
|
|
||
| dimensions [ 1 -1 -1 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0; | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| outlet | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| upperWall | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| lowerWall | ||
| { | ||
| type compressible::alphatWallFunction; | ||
| value uniform 0; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,43 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object epsilon; | ||
| } | ||
|
|
||
| dimensions [ 0 2 -3 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0.01; | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| outlet | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| upperWall | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| lowerWall | ||
| { | ||
| type epsilonWallFunction; | ||
| value uniform 0.01; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,43 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object k; | ||
| } | ||
|
|
||
| dimensions [ 0 2 -2 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0.1; | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| outlet | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| upperWall | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| lowerWall | ||
| { | ||
| type kqRWallFunction; | ||
| value uniform 0.1; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| 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,43 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volScalarField; | ||
| object nut; | ||
| } | ||
|
|
||
| dimensions [ 0 2 -1 0 0 0 0 ]; | ||
|
|
||
| internalField uniform 0; | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type nutkWallFunction; | ||
| value uniform 0; | ||
| } | ||
| outlet | ||
| { | ||
| type nutkWallFunction; | ||
| value uniform 0; | ||
| } | ||
| upperWall | ||
| { | ||
| type nutkWallFunction; | ||
| value uniform 0; | ||
| } | ||
| lowerWall | ||
| { | ||
| type nutkWallFunction; | ||
| value uniform 0; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type empty; | ||
| } | ||
| defaultFaces | ||
| { | ||
| type empty; | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.