CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] how to use funkySetFields function in muliregion case

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Mohammad Jam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2013, 06:12
Default how to use funkySetFields function in muliregion case
  #1
New Member
 
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 15
bryant_k is on a distinguished road
Hello everyone
I want to use funkySetFields function to set the initial nonuniform field in multiregion case.The solver that I am useing is chtMultiregionFoam and the case is modified according to the tutorials name multiRegionHeater.I know how to use funkySetFields in a case which have a singal region.
With the command:
Code:
 funkySetFields -time 0
I can have a initial fields I need successfully.
But in a multiregion case I can not make it work.I know that the foamToTecplot have the function for multiregion.So I try the command according to that:
Code:
funkySetFields -region heater -time 0
or
Code:
funkySetFields  -time 0 -region heater
but it is wrong.

Can you tell me how can I use this funciton in multiregion case?

Thank you very much!

regards!

bryant_K
bryant_k is offline   Reply With Quote

Old   April 26, 2013, 06:28
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bryant_k View Post
Hello everyone
I want to use funkySetFields function to set the initial nonuniform field in multiregion case.The solver that I am useing is chtMultiregionFoam and the case is modified according to the tutorials name multiRegionHeater.I know how to use funkySetFields in a case which have a singal region.
With the command:
Code:
 funkySetFields -time 0
I can have a initial fields I need successfully.
But in a multiregion case I can not make it work.I know that the foamToTecplot have the function for multiregion.So I try the command according to that:
Code:
funkySetFields -region heater -time 0
or
Code:
funkySetFields  -time 0 -region heater
but it is wrong.

Can you tell me how can I use this funciton in multiregion case?

Thank you very much!

regards!

bryant_K
Define "wrong".

I've used it in the past with -region and it worked. But I think that was in "command line"-mode. You're using a dictionary, right? Try specifying an entry "region heater;" there. I must check the source but it is possible that in dictionary mode the -region-option is ignored
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 27, 2013, 06:41
Default
  #3
New Member
 
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 15
bryant_k is on a distinguished road
Thank you for your reply.
I have put the file name funkySetFieldsDict into folder both "system" and "system/heater". Then I run the command
Code:
funkySetFields -region heater -time 0
it occured error:
Code:
can not open 
file:../../multiRegionHeater/system/heater/funkySetFieldsDict.heater at line 0.....
But when I run the command
Code:
funkySetFields -time 0
,it can run fluently without error.
But it just changed the file in folder "0" rather "0/heater".

Then I add entry in the file funkySetFieldsDict:
Code:
expressions
(
    Q1
     {
        field Q;
        expression "...";
        condition "..."
        region heater'
       }
)
It can run without any error,but it also changed the field in folder "0" only.

Can you tell how to add the entry and how can I get fields I want?
Thank you very much!

bryant_k
bryant_k is offline   Reply With Quote

Old   April 28, 2013, 17:54
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bryant_k View Post
Thank you for your reply.
I have put the file name funkySetFieldsDict into folder both "system" and "system/heater". Then I run the command
Code:
funkySetFields -region heater -time 0
it occured error:
Code:
can not open 
file:../../multiRegionHeater/system/heater/funkySetFieldsDict.heater at line 0.....
I checked. It works like this. Look at the error message: the location of the dictionary is in a subdirectory of system, not system itself
Quote:
Originally Posted by bryant_k View Post
But when I run the command
Code:
funkySetFields -time 0
,it can run fluently without error.
But it just changed the file in folder "0" rather "0/heater".

Then I add entry in the file funkySetFieldsDict:
Code:
expressions
(
    Q1
     {
        field Q;
        expression "...";
        condition "..."
        region heater'
       }
)
It can run without any error,but it also changed the field in folder "0" only.

Can you tell how to add the entry and how can I get fields I want?
Thank you very much!
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 11, 2016, 00:01
Default
  #5
Member
 
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11
STutexas is on a distinguished road
Hi

Thank you for your post and your documentation. I am trying to use funkySetFields for setting heterogeneous values of fields in different cell zones. I have already created 2 separate cell zones and I use the following commands in my funkySetFieldsDict file:

setDT
{
field DT;
keepPatches true;
expression "2e-09";
zone PoreWater;
}

setTb
{
field Tb;
keepPatches true;
expression "2";
zone PoreWater;
}

My problem is that funkeSetFields changes the values of DT, Tb fields in the whole domain and not just in the zone PoreWater. Please let me know what am I doing wrongly.

Thank you.

Saurabh
STutexas is offline   Reply With Quote

Old   April 16, 2016, 13:05
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by STutexas View Post
My problem is that funkeSetFields changes the values of DT, Tb fields in the whole domain and not just in the zone PoreWater. Please let me know what am I doing wrongly.
Quick answer: Insufficient details. Please provide more details, namely:
  1. What's the exact command you are using?
  2. Where are the "funkySetFieldsDict" files placed in your case? Namely inside which folder (directory)?
__________________
wyldckat is offline   Reply With Quote

Old   April 16, 2016, 21:46
Default
  #7
Member
 
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11
STutexas is on a distinguished road
Hi

Thank you for your reply. I am using the command funkySetFields -time 0. My funkySetFields file is in system directory. I believe that I am using the command right but the value in the entire domain is changed not just in the defined cell.

Thank you.

Saurabh
STutexas is offline   Reply With Quote

Old   April 17, 2016, 15:22
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Then if you want the correct region to be affected, then you need to:
  1. Place a "funkySetFieldsDict" inside the folder "system/PoreWater".
  2. Run like this:
    Code:
    funkySetFields -time 0 -region PoreWater
This was explained in the posts above
wyldckat is offline   Reply With Quote

Old   April 17, 2016, 15:47
Default
  #9
Member
 
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11
STutexas is on a distinguished road
Hi Bruno

Thank you for your suggestion . But I am not running split mesh during preprocessing. I have regions divided (using toposet) into separate cells with names like pore water, bound water, hydrocarbon etc. I use createBaffles to divide the mesh into separate regions. I set Boundary conditions on the 2 generated boundaries. Now I want to set different (hetrogeneous) properties in these different cells. There is only one system folder .

Please let me know if running splitmesh is necessary for me to properly define these different phases. I am not doing that for now .

Thanks again for your feedback. It has been very helpful.

P.S. I have attached is a simplified .msh that I use. Please unzip and open it with gmsh if you would like a better visualization of my problem. Thanks again.


Saurabh
STutexas is offline   Reply With Quote

Old   April 17, 2016, 16:04
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Sorry, I read the other post too fast

You should use something like this:
Code:
  setTb
  {
    field p_rgh;
    keepPatches true;
    expression "3";
    condition  "zone(porosity)";
  }
Source: http://openfoamwiki.net/index.php/Co...funkySetFields - chapter "Expression syntax" and section "Initialise a pressure field gradient due to gravity".


edit: And you forgot to attach. Either way, I tested with the tutorial case "multiphase/interFoam/ras/angledDuct"

Last edited by wyldckat; April 17, 2016 at 16:06. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   May 1, 2016, 22:38
Default
  #11
Member
 
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11
STutexas is on a distinguished road
Hi Bruno

Thank you for all the help and your advice. I have used set fields for simulation of my case. Thanks again for the help.

I have another question pertaining to the same problem. I am using groovyBC in my simulations. This is what my code looks like.

boundaryField
{
PoreWall
{
type groovyBCDirection;
value uniform (0 0 0);
valueExpression "vector (0, 0, Minf)";
gradientExpression "vector(0,0,0)";
fractionExpression "symmTensor(1/(1+D/(rho2*mag(delta()))),0,0,1/(1+D/(rho2*mag(delta()))),0,1/(1+D/(rho1*mag(delta()))))";
evaluateDuringConstruction 0;
variables
4
(
"D=3e-09;"
"rho2=10e-06;"
"rho1=10e-06;"
"Minf=4.2e-07;"
)
;

}

}

but I would like to change the values of rho2, rho1 and Minf based on the set type in the mesh. For example:

if (set_of_face) == set1
Minf = 4.2;
else
Minf = 2.2;

Is it possible to set type non uniform values in the groovyBCset. I really appreciate all the help that you have given and all the help.

Saurabh
STutexas is offline   Reply With Quote

Old   May 2, 2016, 15:42
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by STutexas View Post
Hi Bruno

Thank you for all the help and your advice. I have used set fields for simulation of my case. Thanks again for the help.

I have another question pertaining to the same problem. I am using groovyBC in my simulations. This is what my code looks like.

boundaryField
{
PoreWall
{
type groovyBCDirection;
value uniform (0 0 0);
valueExpression "vector (0, 0, Minf)";
gradientExpression "vector(0,0,0)";
fractionExpression "symmTensor(1/(1+D/(rho2*mag(delta()))),0,0,1/(1+D/(rho2*mag(delta()))),0,1/(1+D/(rho1*mag(delta()))))";
evaluateDuringConstruction 0;
variables
4
(
"D=3e-09;"
"rho2=10e-06;"
"rho1=10e-06;"
"Minf=4.2e-07;"
)
;

}

}

but I would like to change the values of rho2, rho1 and Minf based on the set type in the mesh. For example:

if (set_of_face) == set1
Minf = 4.2;
else
Minf = 2.2;

Is it possible to set type non uniform values in the groovyBCset. I really appreciate all the help that you have given and all the help.

Saurabh
You can always use the condition-operator in expressions "cond ? 4.2 : 2.2" for such a thing with cond being your conditon. I just don't understand what you mean with "set type in the mesh"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 1, 2016, 05:40
Default
  #13
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by bryant_k View Post
Thank you for your reply.
I have put the file name funkySetFieldsDict into folder both "system" and "system/heater". Then I run the command
Code:
funkySetFields -region heater -time 0
it occured error:
Code:
can not open 
file:../../multiRegionHeater/system/heater/funkySetFieldsDict.heater at line 0.....
But when I run the command
Code:
funkySetFields -time 0
,it can run fluently without error.
But it just changed the file in folder "0" rather "0/heater".

Then I add entry in the file funkySetFieldsDict:
Code:
expressions
(
    Q1
     {
        field Q;
        expression "...";
        condition "..."
        region heater'
       }
)
It can run without any error,but it also changed the field in folder "0" only.

Can you tell how to add the entry and how can I get fields I want?
Thank you very much!

bryant_k
Hi Dears

u should probably change funkySetFieldsDict name with funkySetFieldsDict.heater after u put funkySetFieldsDict in heater folder in system folder
(ADD dot heater)= .heater

then run funkySetFields -time 0 -region heater
thiagopl likes this.
Mohammad Jam is offline   Reply With Quote

Old   April 21, 2020, 06:47
Default funkySetFields
  #14
New Member
 
Muyiwa
Join Date: Feb 2020
Posts: 12
Rep Power: 6
Muyiwa is on a distinguished road
Hello Foamers

Please show me how to use funkySetFields to create an undulating initial field for alpha.water in the damBreak tutorial. I want to use undulating surface instead of the boxToCell used in the setFields of the tutorial.
Muyiwa is offline   Reply With Quote

Old   January 27, 2021, 05:10
Default
  #15
Member
 
ESI
Join Date: Sep 2017
Posts: 49
Rep Power: 9
ht2017 is on a distinguished road
Quote:
Originally Posted by Muyiwa View Post
Hello Foamers

Please show me how to use funkySetFields to create an undulating initial field for alpha.water in the damBreak tutorial. I want to use undulating surface instead of the boxToCell used in the setFields of the tutorial.
do you have success with funkySetFields? If you did it. could you share with me how to do it?
ht2017 is offline   Reply With Quote

Old   October 15, 2021, 03:50
Default
  #16
Senior Member
 
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13
harsha_kulkarni is on a distinguished road
Quote:
Originally Posted by Muyiwa View Post
Hello Foamers

Please show me how to use funkySetFields to create an undulating initial field for alpha.water in the damBreak tutorial. I want to use undulating surface instead of the boxToCell used in the setFields of the tutorial.
Have you succeed in your work..
I want to set dam tilted at an angle of 50 degree
harsha_kulkarni is offline   Reply With Quote

Reply

Tags
funkysetfields


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 121 June 11, 2021 11:05
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23


All times are GMT -4. The time now is 16:26.