|
[Sponsors] |
April 11, 2016, 12:22 |
Problem with setFields and boxToCell
|
#1 |
New Member
Join Date: Apr 2016
Posts: 6
Rep Power: 10 |
Hello everyone,
I am using OpenFOAM 2.1.1. I have seen the tutorials concerning the setFields utility and I had no problem. Now for my project, I'm trying to set alpha1 equal to 1 in a part of a box. The box has sizes 1mm*2mm*0.5mm. The mesh is built without problem. Then, I wrote in the setFieldsDict: ---- defaultFieldValues ( volScalarFieldValue alpha1 0 ); regions ( boxToCell { box (-0.002 0 -0.001) (-0.0018 -0.0005 0); fieldValues ( volScalarFieldValue alpha1 1 ); } ); ---- From terminal I run setFields and no error message is given. However, no change is done on the file alpha1 ( I still have alpha1 = 0 everywhere in the box) I can't understand why i don't see my alpha1. Can it be because of the small size of my box? Can it be because of the old version of OpenFOAM I'm using? Can you help me? |
|
April 11, 2016, 15:57 |
|
#2 |
Senior Member
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 11 |
Hi rekap,
When you enter setFields in terminal,if you see that some cells assign to alpha1 = 0,your code work correctly and you should investigate two factor: 1.maybe you don't enter cp 0/alpha1.org 0/alpha1 2.your box is out of your domain |
|
April 13, 2016, 04:49 |
|
#3 |
New Member
Join Date: Apr 2016
Posts: 6
Rep Power: 10 |
Hi Hesam,
Thank you for your answer. As you said my box was out of my domain: I solved the problem by using the following command: box (-0.002 -0.0005 -0.001) (-0.0018 0 0); |
|
July 12, 2016, 16:37 |
|
#4 |
New Member
Madeleine
Join Date: Jun 2016
Posts: 14
Rep Power: 10 |
Hi to you,
my problem is familiar with yours. I want to make a box of water in my channel and when I run set Fields only the inlet is filled with water and not the whole channel as it should be. I want to rise a field from (0 0 0) (-15 1.75 -0.85) could it be that setFields hase a problem with the negative values? My alphaWater file doesnt change too. I put my case files in the attachment and would be glad if someone have a look. Thanks. |
|
July 28, 2016, 13:09 |
|
#5 | |
New Member
mohsen ari.
Join Date: Apr 2013
Posts: 12
Rep Power: 13 |
Hi,
The diagonal of the box is not well defined for the two extremes. You should modify your box: box (0 0 0) (-5 0.5 0.1); maybe to box (-5 0 0) (0 0.5 0.1); Best, Mohsen Quote:
|
||
March 8, 2018, 09:39 |
SetField boxtoCell warning
|
#6 |
New Member
Felicity
Join Date: Jan 2018
Location: South Africa
Posts: 3
Rep Power: 8 |
Hello.
I am working on fluidized bed with porous media and i`m trying to specify the particle to only fill up the bed above the porous media. i find this error FOAM Warning : From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream) in file setFields.C at line 124 Field alpha.air not found Setting internal values of volScalarField alpha.particles End then there are no particles in the fluidized bed. the blockmesh for the fluidized bed is convertToMeters 1; vertices ( // inlet region ( 0 0 0 ) // pt 0 (in1b) ( 100 0 0 ) // pt 1 (in2b) ( 0 0 10 ) // pt 2 (in1f) (100 0 10 ) // pt 3 (in2f) // join inlet->outlet ( 0 50 0 ) // pt 4 (join1b) ( 100 50 0) // pt 5 (join2b) ( 0 50 10) // pt 6 (join1f) ( 100 50 10) // pt 7 (join2f) // porosity ends ->outlet ( 0 60 0) // pt 8 (poro1b) ( 100 60 0 ) // pt 9 (poro2b) ( 0 60 10) // pt 10 (poro1f) ( 100 60 10 ) // pt 11 (poro2f) // outlet ( 0 440 0 ) // pt 12 (out1b) ( 100 440 0 ) // pt 13 (out2b) ( 0 440 10 ) // pt 14 (out1f) ( 100 440 10 ) // pt 15 (out2f) ); blocks ( // inlet block hex (0 4 5 1 2 6 7 3) inlet ( 20 20 1 ) simpleGrading (1 1 1) // porosity block hex (4 8 9 5 6 10 11 7) porosity ( 20 20 1 ) simpleGrading (1 1 1) // outlet block hex (8 12 13 9 10 14 15 11) outlet ( 20 20 1 ) simpleGrading (1 1 1) ); edges ( ); patches ( // is there no way of defining all my 'defaultFaces' to be 'wall'? empty frontAndBackPlanes ( // inlet block (2 6 7 3) // outlet block (10 14 15 11) // inlet block (1 5 4 0) // outlet block (9 13 12 8) ) wall walls ( // inlet block (2 0 4 6) (7 5 1 3) // outlet block (10 8 12 14) (15 13 9 11) ) wall porosityWall ( // porosity block (6 10 11 7) // porosity block (5 9 8 4) // porosity block (6 4 8 10) (11 9 5 7) ) patch inlet ( (3 1 0 2) ) patch outlet ( (15 13 12 14) this is the setFieldDic: defaultFieldValues ( volScalarFieldValue alpha.air 1 volScalarFieldValue alpha.particles 0 ); regions ( boxToCell { box ( 0 0.6 0.1 ) ( 0.15 0.75 0.1 ); fieldValues ( volScalarFieldValue alpha.air 0.45 volScalarFieldValue alpha.particles 0.55 What should i do?please help |
|
Tags |
alpha1, boxtocell, setfieldsdict |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to use setFields in multiregionsolver | lg88 | OpenFOAM | 18 | June 12, 2022 19:57 |
setFields not working | dsanza | OpenFOAM | 4 | October 18, 2018 10:43 |
how to use setFields for flame ignition?? | Dan1788 | OpenFOAM Running, Solving & CFD | 5 | September 25, 2014 21:26 |
Problems with the execution of the setFields utility. | foamer | OpenFOAM Pre-Processing | 5 | June 3, 2013 13:24 |
setFields: possible keywords? | AlmostSurelyRob | OpenFOAM | 2 | February 22, 2011 04:48 |