|
[Sponsors] |
![]() |
![]() |
#1 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 12 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 12 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 12 ![]() |
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 10:08. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 12 ![]() |
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 12:00. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 12 ![]() |
Hi Ghassan
I have found my problem and it can run now.Thank you all the same! regards! jack |
|
![]() |
![]() |
![]() |
![]() |
#6 | |
New Member
Join Date: Jul 2009
Location: Wrentham, MA
Posts: 9
Rep Power: 14 ![]() |
For OpenFOAM-2.1.x the setFields can be made multiregional if the following changes are made to setFields.C
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#7 | |
Member
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 11 ![]() |
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 |
||
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 12 ![]() |
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 |
||
![]() |
![]() |
![]() |
![]() |
#9 |
Member
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 11 ![]() |
Dear ghas
So nice of you, it helped me to solve the problem... Thanks |
|
![]() |
![]() |
![]() |
![]() |
#10 | |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 6 ![]() |
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! |
||
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 12 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 6 ![]() |
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! |
|
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
JOMAA Ghassan
Join Date: Jan 2012
Location: Paris
Posts: 8
Rep Power: 12 ![]() |
> sudo su
> enter your password > source /opt/openfoam4/etc/bashrc > cd /opt/openfoam4/applications/utilities/preProcessing/mysetFields > wmake Regards |
|
![]() |
![]() |
![]() |
![]() |
#14 | |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 6 ![]() |
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! |
||
![]() |
![]() |
![]() |
![]() |
#15 |
Member
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 6 ![]() |
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! |
|
![]() |
![]() |
![]() |
![]() |
#16 |
Member
Vivek
Join Date: Mar 2018
Location: India
Posts: 51
Rep Power: 6 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#17 | |
New Member
Marco Rosatti
Join Date: Mar 2019
Location: Argentina
Posts: 2
Rep Power: 0 ![]() |
Quote:
Greetings! |
||
![]() |
![]() |
![]() |
Tags |
setfields |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
setFields not working | dsanza | OpenFOAM | 4 | October 18, 2018 09:43 |
Problems with the execution of the setFields utility. | foamer | OpenFOAM Pre-Processing | 5 | June 3, 2013 12:24 |
setFields tool does not assign water volume for given mesh. | paka | OpenFOAM | 2 | June 7, 2012 09:17 |
OF 1.6-ext setFields does not keep patch values | Arnoldinho | OpenFOAM Bugs | 3 | May 9, 2012 03:58 |
question on setFields | fijinx | OpenFOAM Running, Solving & CFD | 1 | February 15, 2010 15:07 |