|
[Sponsors] |
August 1, 2012, 05:37 |
how to use setFields in multiregionsolver
|
#1 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
Hello everyone
I am simulating a FSI problem with multiregionsolver.In my case,there are only two regions, solid and fluid.Now I want to use the function setFields to set a quantity ,for example initial volume fraction, in fluid region. I tried to put the setFieldsDict file in system/fluid floder,then run Code:
setFields -region solid Code:
setFields The following is the details of the file setFieldsDict in my case: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue sigma 2 ); regions ( boxToCell { box (-1.1 -1.1 0) (-1.0 1.1 5); fieldValues ( volScalarFieldValue sigma 0.01 ); } boxToCell { box (1.0 -1.1 0) (1.1 1.1 5); fieldValues ( volScalarFieldValue sigma 0.01 ); } ); // ************************************************** **** // So where should I put the setFieldsDict and how to modified it? regards! lg88 |
|
August 2, 2012, 08:42 |
|
#2 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 14 |
Hi Jack,
To do that, follow the following steps: 1- cd $WM_PROJECT_DIR/applications/utilities/preProcessing 2- cp -r setFields $WM_PROJECT_USER_DIR/applications/utilities/preProcessing 3- Rename the directory and the source file name, clean all the dependancies and > mv setFields mysetFields > cd mysetFields > mv setFields.C mysetFields.C > wclean 5- Add the region option to mysetFields.C file by # include "addRegionOption.H" 6- Replace the line # include "createMesh.H" by: # include "createNamedPolyMesh.H" 7- Open Make/files and modify it as follows: mysetFields.C EXE = $(FOAM_USER_APPBIN)/mysetFields 8- Compile the utility by wmake 9- Now your utility is ready to be ued: > mysetFields -region solid Best regards Ghassan |
|
August 2, 2012, 10:44 |
|
#3 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
Hi Ghassan
I have done as you said and it works correctly.Thank you very much! By the way,do you know how to convert the result data of different regions to tecplot360? I use the following command,but the converted data can not work in tecplot. Code:
foamToTecplot360 -region fluid foamToTecplot360 -region solid lg88 Last edited by lg88; August 2, 2012 at 11:08. |
|
August 2, 2012, 12:44 |
|
#4 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 14 |
Hi jack,
The foamTotecplot supports the multi-region option and I think that there is another proplem in your run. what's the error message ? Best regards, Ghassan Last edited by ghas; August 2, 2012 at 13:00. |
|
August 2, 2012, 20:39 |
|
#5 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 15 |
Hi Ghassan
I have found my problem and it can run now.Thank you all the same! regards! jack |
|
November 26, 2012, 14:38 |
setFields multiregion fix for 2.1.x
|
#6 | |
New Member
Join Date: Jul 2009
Location: Wrentham, MA
Posts: 9
Rep Power: 17 |
For OpenFOAM-2.1.x the setFields can be made multiregional if the following changes are made to setFields.C
Quote:
|
||
January 14, 2013, 15:51 |
|
#7 | |
Member
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 13 |
Dear
I am using OF 2.1.0 and I am trying to modify setFields utility to work on multiRegion and I have followed the same steps which are given but I am facing error Quote:
Regards, Jamal |
||
January 14, 2013, 16:21 |
|
#8 | |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 14 |
Quote:
I think that you uncommented "// Get times list" by the ommision of "//" . You can find the modified code of setFields in the attached file. Best Regards, Ghassan |
||
January 15, 2013, 06:01 |
|
#9 |
Member
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 13 |
Dear ghas
So nice of you, it helped me to solve the problem... Thanks |
|
June 18, 2018, 11:23 |
|
#10 | |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 9 |
Quote:
I was trying the same procedure but failed, the following is the error msg i got. May you help please. /opt/openfoam4/applications/utilities/preProcessing/mysetFields mkdir: cannot create directory ‘/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications’: Permission denied /bin/sh: 1: cannot create /opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/options: Directory nonexistent make: *** No rule to make target '/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/options'. Stop. /bin/sh: 1: cannot create /opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/options: Directory nonexistent make: *** No rule to make target '/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/options', needed by 'all'. Stop. wmake error: file '/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/sourceFiles' could not be created in /opt/openfoam4/applications/utilities/preProcessing/mysetFields Regard! |
||
June 18, 2018, 11:44 |
|
#11 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 14 |
You need to modify the location of the binary executable file mysetFields(or run wmake as a super user). To do so, you can just repalce the last line of Make/files:
EXE = $(FOAM_APPBIN)/mysetFields by EXE = $(FOAM_USER_APPBIN)/mysetFields regards |
|
June 18, 2018, 11:50 |
|
#12 |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 9 |
Thank you for quick feedback.
That one i did as it has been instructed : May be that of running it as super user is what i didn't. How is it done(run as super user.)? Regard! |
|
June 18, 2018, 11:56 |
|
#13 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 14 |
> sudo su
> enter your password > source /opt/openfoam4/etc/bashrc > cd /opt/openfoam4/applications/utilities/preProcessing/mysetFields > wmake Regards |
|
June 18, 2018, 16:34 |
|
#14 | |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 9 |
Quote:
Did you succeed with this case, may you share the setup and results you got? is it possible to replace the boxTocell with a cylinder? Thank you! |
||
June 22, 2018, 06:15 |
immersed cylinder
|
#15 |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 9 |
Hello Foamers,
I would like to ask how the modified setFieldsDict is used in FSI simulation. Indeed, I want to simulate flow over a cylinder(stationary and oscillating). I have used toposetDict to map that cylinder in fluid Cartesian domain. Let: eta=1 solid region, eta=0 fluid region. Then i have a c++ code that gives me a value of eta each time step. The eta's value alternate from 0 to 1 and from 1 to 0. C++ code prints eta values in .dat format. I am asking if it is possible to use setFieldsDict to move (oscillating motion) that cylinder as eta changes. what should be my code looking like? I will be happy to hear from you! Regard! |
|
July 11, 2018, 13:30 |
|
#16 |
Member
Vivek
Join Date: Mar 2018
Location: India
Posts: 54
Rep Power: 8 |
Hi
i am facing problem in setFields usage. simulating spray using interFoam solver .when i run setFields command it doesnt make any changes in 0/alpha.water folder. i am using boxTocell (0 0.1 -1) (0.06 0.1 1) these dimension are my fuel inlet coordinates. |
|
April 13, 2022, 10:01 |
setFields i OF ESI 2112
|
#17 | |
New Member
Marco Rosatti
Join Date: Mar 2019
Location: Argentina
Posts: 4
Rep Power: 7 |
Quote:
Greetings! |
||
June 12, 2022, 14:39 |
|
#18 | |
Member
Michael Jensen
Join Date: May 2022
Posts: 36
Rep Power: 4 |
Quote:
Code:
eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing$ mv setFields mysetFields mv: cannot move 'setFields' to 'mysetFields': Permission denied Edit: based on ghas's comment [10:56], I conclude I'm supposed to do this with sudo. Edit 2: my file doesn't have this line: "# include "createMesh.H"" -the closest I come is " #include "createNamedMesh.H"", half-way down the file. Edit 3: I've been reading the forum rules, and concluded that this is in the wrong place. I'm "hijacking" the thread. ..So somehow I have to come up with a new original title for a new thread.. Last edited by mikethe1wheelnut; June 12, 2022 at 20:03. Reason: ..self-explanatory.. |
||
June 12, 2022, 19:57 |
Instructions not completely clear, or other problems..
|
#19 | |
Member
Michael Jensen
Join Date: May 2022
Posts: 36
Rep Power: 4 |
Quote:
I have got, in principle, to the stage of compiling with wmake. I get the following errors: Code:
eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing/mysetFields$ wmake mkdir: cannot create directory ‘/opt/openfoam9/platforms/linux64GccDPInt32Opt/applications’: Permission denied /bin/sh: 1: cannot create /opt/openfoam9/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/files: Directory nonexistent make: *** [/opt/openfoam9/wmake/makefiles/files:59: /opt/openfoam9/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/files] Error 2 wmake error: file '/opt/openfoam9/platforms/linux64GccDPInt32Opt/applications/utilities/preProcessing/mysetFields/files' could not be created in /opt/openfoam9/applications/utilities/preProcessing/mysetFields eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing/mysetFields$ sudo wmake [sudo] password for eriadar: sudo: wmake: command not found eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing/mysetFields$ ls /usr/bin/make /usr/bin/make eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing/mysetFields$ /usr/bin/make --version GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. eriadar@eriadar-Latitude-E7440:/opt/openfoam9/applications/utilities/preProcessing/mysetFields$ In the instructions, I've made the assumption that: Code:
> mv setFields mysetFields > cd mysetFields > mv setFields.C mysetFields.C > wclean 5- Add the region option to mysetFields.C file by # include "addRegionOption.H" 6- Replace the line # include "createMesh.H" by: # include "createNamedPolyMesh.H" 7- Open Make/files and modify it as follows: mysetFields.C EXE = $(FOAM_USER_APPBIN)/mysetFields Code:
$WM_PROJECT_DIR/applications/utilities/preProcessing Code:
$WM_PROJECT_USER_DIR/applications/utilities/preProcessing Edit: Please see my most recent "progress" here: Compilation problems adapting setFields for multiregionsolver Last edited by mikethe1wheelnut; June 13, 2022 at 03:29. Reason: added link to new thread with the problems I'm having. |
||
Tags |
setfields |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
setFields not working | dsanza | OpenFOAM | 4 | October 18, 2018 10:43 |
Problems with the execution of the setFields utility. | foamer | OpenFOAM Pre-Processing | 5 | June 3, 2013 13:24 |
setFields tool does not assign water volume for given mesh. | paka | OpenFOAM | 2 | June 7, 2012 10:17 |
OF 1.6-ext setFields does not keep patch values | Arnoldinho | OpenFOAM Bugs | 3 | May 9, 2012 04:58 |
question on setFields | fijinx | OpenFOAM Running, Solving & CFD | 1 | February 15, 2010 16:07 |