|
[Sponsors] |
August 5, 2019, 02:21 |
Zalesak's Disk with InterFoam
|
#1 |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Hi every one,
I am trying to simulate the Zalesak's Disk with InterFoam. However, I could not find any tutorial and set up for this simulation. Could anyone can share with me the setting up of this problems. Thanks and Best regards, |
|
August 5, 2019, 03:45 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Why do you need a tutorial? It's pretty straight-forward. At which point do you encounter difficulties?
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 5, 2019, 04:46 |
|
#3 |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Dear Akidess,
Thanks for your comment, I do not know how to setup the initial condition for problem. Please share with me your experiences for this case. Thanks |
|
August 5, 2019, 08:32 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Use setFields with a circle with alpha=1 and a rectangle with alpha=0.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 5, 2019, 11:51 |
Please guide me how to setup condition for velocity fields
|
#5 |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Dear Akidess,
For the initial setup, I understand that it is assigned with setFields. However, I do not know how set up velocity following the equation as shown in attached picture. Can you share with me your experiences on this issues. Thanks |
|
August 6, 2019, 03:57 |
|
#6 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
You can easily do that with the community addon funkySetFields.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 6, 2019, 06:15 |
|
#7 |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
||
August 6, 2019, 08:11 |
|
#8 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
No. Have a look at the documentation / tutorials first:
http://openfoamwiki.net/index.php/Co...funkySetFields If you have specific questions I'll answer them.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 8, 2019, 19:18 |
|
#9 | |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Quote:
For simple, I have also made expression for creating circle inside a square box. However, I do not know how to make expression for velocity of circle since it has no boundary. For more detail in discussion, could I share my problem with you via email. My email is ndtrong@hotmail.com, could you contact me there |
||
August 12, 2019, 18:20 |
|
#10 | |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Quote:
I tried to generate a Zaselak's disc by using funkySetFields as: diskGamma0 { // field alpha1; field alpha.water; expression "1"; condition "pow(pos().x-0.0,2) + pow(pos().y-0.25,2) < pow(0.15,2)"; } diskGamma1 { // field alpha1; field alpha.water; expression "0"; condition "pos().x > -0.025 && pos().x < 0.025 && pos().y > 0.15 && pos().y < 0.5"; } However, when I run funkySetFields -time 0, it shows error like this: --> FOAM FATAL ERROR: The type of the alpha.water is IOobject. Seems that it doesn't exist. Use 'create' From function doAnExpression() in file funkySetFields.C at line 414. FOAM exiting Do you have any comments or suggestions for this stuck? Thanks |
||
August 20, 2019, 04:47 |
|
#11 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
The file for alpha in the 0 folder must be present (and boundary conditions must be set properly) before you can manipulate it with funkysetfields. I'm guessing that's the problem.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 20, 2019, 19:07 |
|
#12 | |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Quote:
FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { bottom { type zeroGradient; } outlet { type zeroGradient; } walls { type zeroGradient; } defaultFaces { type empty; } } // ************************************************** *********************** // Do you have any comments for this declaration? Last edited by ndtrong; August 20, 2019 at 19:08. Reason: missing information |
||
August 21, 2019, 12:07 |
|
#13 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
You say you have a file "alpha", but you are trying to manipulate a file "alpha.water".
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 21, 2019, 19:17 |
|
#14 | |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Quote:
Thanks for your comment, now I can initiate field of alpha.water. I am trying to initiate the fields of velocity as below: circleVel { variables ( "vx = cos(pi*pos().x) * sin(pi * pos().y);" "vy = -sin(pi*pos().x) * cos(pi * pos().y);" ); field U; expression "vector(vx, vy, 0)"; } However, I got following error: Part: circleVel Modifying field U of type volVectorField Putting "vector(vx, vy, 0)" into field U at t = "0" if condition "true" is true swak4Foam: Allocating new repository for sampledMeshes swak4Foam: Allocating new repository for sampledGlobalVariables --> FOAM Warning : From function ConcretePluginFunction<DriverType>::exists in file lnInclude/ConcretePluginFunction.C at line 116 Constructor table of plugin functions for FieldValueExpressionDriver is not initialized --> FOAM FATAL ERROR: Parser Error for driver FieldValueExpressionDriver at "1.8-9" :"field vx not existing or of wrong type" "vector(vx, vy, 0)" ^^ ---------| Context of the error: - Driver constructed from scratch Evaluating expression "vector(vx, vy, 0)" From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 1246. FOAM exiting Can you suggest me the way to fix this issue. Thanks |
||
August 22, 2019, 06:07 |
|
#15 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
I think your syntax is bad. Try
Code:
circleVel { variables "vx = cos(pi*pos().x) * sin(pi * pos().y); vy = -sin(pi*pos().x) * cos(pi * pos().y);"; field U; expression "vector(vx, vy, 0)"; }
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
August 22, 2019, 12:28 |
|
#16 | |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Quote:
Thanks for your comments. However, it still shows errors as before: --> FOAM FATAL ERROR: Parser Error for driver FieldValueExpressionDriver at "1.8-9" :"field vx not existing or of wrong type" "vector(vx, vy, 0)" ^^ ---------| Context of the error: - Driver constructed from scratch Evaluating expression "vector(vx, vy, 0)" From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 1246. FOAM exiting The error is caused by another reason, could you suggest me the other options. Thanks |
||
August 28, 2019, 18:44 |
|
#18 |
Senior Member
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12 |
Dear akidess,
Following the complete declaration of my funkySetFieldsDict: FoamFile { version 2.0; format ascii; class dictionary; location "system"; object funkySetFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // expressions ( circleGamma0 { field alpha.water; expression "0"; condition "pow(pos().x-0.5,2) + pow(pos().y-0.75,2) < pow(0.15,2)"; } circleGamma1 { field alpha.water; expression "1"; condition "pow(pos().x-0.5,2) + pow(pos().y-0.75,2) > pow(0.15,2)"; } circleVel { variables "vx = cos(pi*pos().x) * sin(pi * pos().y); vy = -sin(pi*pos().x) * cos(pi * pos().y);"; field U; expression "vector(vx, vy, 0)"; } ); Please take a quick look and guide me to resolve this error. Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interFoam vs. simpleFoam channel flow comparison | DanM | OpenFOAM Running, Solving & CFD | 12 | January 31, 2020 16:26 |
Compute Zalesak's disk | jianfeng | OpenFOAM Running, Solving & CFD | 2 | August 28, 2019 05:30 |
ActuatorDiskExplicitForce in OF2.1. Help | be_inspired | OpenFOAM Programming & Development | 10 | September 14, 2018 12:12 |
Virtual Disk Model-Report | afarkas | STAR-CCM+ | 2 | July 7, 2017 06:29 |
k-e & GAMG interFoam Schemitisation Stability Issue | JFM | OpenFOAM Running, Solving & CFD | 3 | December 1, 2015 06:58 |