CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Zalesak's Disk with InterFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2019, 02:21
Default Zalesak's Disk with InterFoam
  #1
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
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,
ndtrong is offline   Reply With Quote

Old   August 5, 2019, 03:45
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 5, 2019, 04:46
Default
  #3
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
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
ndtrong is offline   Reply With Quote

Old   August 5, 2019, 08:32
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 5, 2019, 11:51
Default 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
ndtrong is on a distinguished road
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


Quote:
Originally Posted by akidess View Post
Use setFields with a circle with alpha=1 and a rectangle with alpha=0.
Attached Images
File Type: png Untitled.png (12.1 KB, 40 views)
ndtrong is offline   Reply With Quote

Old   August 6, 2019, 03:57
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 6, 2019, 06:15
Default
  #7
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
You can easily do that with the community addon funkySetFields.
I am new in OpenFOAM and have no experiences using funkySetFields. Could you guide me please.
ndtrong is offline   Reply With Quote

Old   August 6, 2019, 08:11
Default
  #8
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 8, 2019, 19:18
Default
  #9
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
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.
I have already install swak4Foam with funkySetFields library included.
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
ndtrong is offline   Reply With Quote

Old   August 12, 2019, 18:20
Default
  #10
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
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.
Dear Akidess,


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
ndtrong is offline   Reply With Quote

Old   August 20, 2019, 04:47
Default
  #11
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 20, 2019, 19:07
Default
  #12
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
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.
I have a file for alpha in the 0 folder as below:


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
ndtrong is offline   Reply With Quote

Old   August 21, 2019, 12:07
Default
  #13
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 21, 2019, 19:17
Default
  #14
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
You say you have a file "alpha", but you are trying to manipulate a file "alpha.water".
Dear akidess,


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
ndtrong is offline   Reply With Quote

Old   August 22, 2019, 06:07
Default
  #15
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   August 22, 2019, 12:28
Default
  #16
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
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)";
}
Dear akidess,


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
ndtrong is offline   Reply With Quote

Old   August 23, 2019, 05:15
Default
  #17
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Please post your complete funkySetDict.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   August 28, 2019, 18:44
Default
  #18
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by akidess View Post
Please post your complete funkySetDict.
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
ndtrong is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:46.