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

internal field

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By Phicau
  • 1 Post By Phicau
  • 4 Post By Phicau
  • 1 Post By libia87

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2012, 06:56
Default internal field
  #1
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
Hi!

I have a cylinder and I want to simulate the concentration.
my problem is: I have the cylinder split in 20 parts and I want to say that 10 volums are C=0.5 and the others 10 volums C=-0.5.

how can I put this in the /0?? becouse in internalField can only be one value ... and I want to specify the volums, not the surfaces

Thanks!
libia87 is offline   Reply With Quote

Old   April 26, 2012, 07:04
Default
  #2
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
You can use setFields for that purpose. Check the damBreak tutorial for an example.

Regards
Phicau is offline   Reply With Quote

Old   April 26, 2012, 07:36
Default
  #3
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
Quote:
Originally Posted by Phicau View Post
You can use setFields for that purpose. Check the damBreak tutorial for an example.

Regards
ok!!! thanks

i have another question, in the example of break damm

defaultFieldValues
(
volScalarFieldValue alpha1 0
);

regions
(
boxToCell
{
box (0 0 -1) (0.1461 0.292 1);
fieldValues
(
volScalarFieldValue alpha1 1
);
}
);

what is box (0 0 -1) (0.1461 0.292 1);?? I know that the second parentesis is the coordinates x,y,z , but (0 0 -1) i don't know what it is.

and in my case that i have a cylinder, how can I describe the coordinates if it's cylindrical??

thanks
libia87 is offline   Reply With Quote

Old   April 26, 2012, 08:49
Default
  #4
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16
ybapat is on a distinguished road
Hello,

For cylinderical region you need to use cylinderToCell.
ybapat is offline   Reply With Quote

Old   April 26, 2012, 10:39
Default
  #5
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
All the cells whose center is within a box with lower corner (minX minY minZ) = (0 0 -1) and upper corner (maxX maxY maxZ) = (0.1461 0.292 1) get the alpha1 = 1.

Depending on the geometry of the 20 parts you may need to use cylinderToCell as Yogesh says, or you can continue using boxToCell.
vsammartano likes this.
Phicau is offline   Reply With Quote

Old   April 27, 2012, 04:08
Default
  #6
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
Quote:
Originally Posted by Phicau View Post
All the cells whose center is within a box with lower corner (minX minY minZ) = (0 0 -1) and upper corner (maxX maxY maxZ) = (0.1461 0.292 1) get the alpha1 = 1.

Depending on the geometry of the 20 parts you may need to use cylinderToCell as Yogesh says, or you can continue using boxToCell.
ok thanks! but in the cylinder the lower corner and de upper corner which numbers I have to put??

the cylinder is split in 20 similar parts, like 20 small cylinders
libia87 is offline   Reply With Quote

Old   April 27, 2012, 04:19
Default
  #7
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
cylinderToCell has a different input, 2 points and a radius instead of a box:

p1 (0 -0.08 0);
p2 (0 0.06 0);
radius 0.12;
libia87 likes this.
Phicau is offline   Reply With Quote

Old   April 27, 2012, 04:21
Default
  #8
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
defaultFieldValues
(
volScalarFieldValue p 0
);

regions
(
cylinderToCell
{
cylinder (0 0 0) (0 0 2.5) 1.25;
fieldValues
(
volScalarFieldValue p 1
);
}
);


with this setFields give me an error, FOAM FATAL IO ERROR: keyword p1 is undefined in dictionary cylinderToCell

what does it mean?
libia87 is offline   Reply With Quote

Old   April 27, 2012, 04:24
Default
  #9
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
It asks for word p1, as you have not specified the points:

defaultFieldValues
(
volScalarFieldValue p 0
);

regions
(
cylinderToCell
{
p1 (0 0 0);
p2 (0 0 2.5);
radius 1.25;
fieldValues
(
volScalarFieldValue p 1
);
}
);
libia87, shash, jiaojiao and 1 others like this.
Phicau is offline   Reply With Quote

Old   April 27, 2012, 04:27
Default
  #10
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
Quote:
Originally Posted by phicau View Post
it asks for word p1, as you have not specified the points:

Defaultfieldvalues
(
volscalarfieldvalue p 0
);

regions
(
cylindertocell
{
p1 (0 0 0);
p2 (0 0 2.5);
radius 1.25;
fieldvalues
(
volscalarfieldvalue p 1
);
}
);
thanks!!!!!
ebtedaei likes this.
libia87 is offline   Reply With Quote

Old   May 18, 2012, 11:18
Default
  #11
New Member
 
Andrea Cristina
Join Date: May 2012
Location: Milano
Posts: 4
Rep Power: 14
AC87 is on a distinguished road
Hi
i have this error with the tool cylinderToCell

--> FOAM FATAL IO ERROR:
keyword fieldValues is undefined in dictionary "::cylinderToCell"

Can you help me?
AC87 is offline   Reply With Quote

Old   February 4, 2015, 04:20
Default
  #12
New Member
 
Warning
Join Date: Jan 2015
Posts: 15
Rep Power: 11
range_rover is on a distinguished road
Quote:
Hi
i have this error with the tool cylinderToCell

--> FOAM FATAL IO ERROR:
keyword fieldValues is undefined in dictionary "::cylinderToCell"

Can you help me?
check out the spelling of of fieldvalues then
range_rover is offline   Reply With Quote

Old   March 11, 2016, 13:12
Default
  #13
New Member
 
Alpha Beta
Join Date: Mar 2016
Posts: 28
Rep Power: 10
xoitx is on a distinguished road
HI
I get this message after pasting your code to setfeildsdict

Setting field default values
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field p not found

Setting field region values
Adding cells with centre within cylinder, with p1 = (0 0 -0.003), p2 = (0 0 0.003) and radius = 0.003
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field p not found (I'm guessing this has to do with p file.. but I have p_rgh??? :O)

End

Can you help please?

Last edited by xoitx; March 11, 2016 at 14:54.
xoitx is offline   Reply With Quote

Old   March 31, 2016, 11:57
Default
  #14
New Member
 
Join Date: Oct 2015
Posts: 15
Rep Power: 11
martel is on a distinguished road
Quote:
Originally Posted by xoitx View Post
HI
I get this message after pasting your code to setfeildsdict

Setting field default values
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field p not found

Setting field region values
Adding cells with centre within cylinder, with p1 = (0 0 -0.003), p2 = (0 0 0.003) and radius = 0.003
--> FOAM Warning :
From function void setCellFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 124
Field p not found (I'm guessing this has to do with p file.. but I have p_rgh??? :O)

End

Can you help please?
Hi Xoitx,

I have the same problem!, Did you find a solution?

Regards,

--Carlos
martel is offline   Reply With Quote

Old   March 31, 2016, 12:49
Default
  #15
New Member
 
Alpha Beta
Join Date: Mar 2016
Posts: 28
Rep Power: 10
xoitx is on a distinguished road
Hi Carlos
I solved it using this
Quote:
// Cells underneath plane such that volume is reached. E.g. for use
// // in setFields to set the level given a wanted volume.
// source targetVolumeToCell;
// sourceInfo
// {
// volume 2e-05;
// normal (0 1 0); // usually in direction of gravity//This is the vector (normal) of the plane
// }
you can find all of the commands and usage here:
openfoam30/applications/utilities/mesh/manipulation/topoSet/
There is a file called topoSetDict
Check it out

Regards
Xoitx
xoitx is offline   Reply With Quote

Old   March 31, 2016, 12:53
Default
  #16
New Member
 
Join Date: Oct 2015
Posts: 15
Rep Power: 11
martel is on a distinguished road
Quote:
Originally Posted by xoitx View Post
Hi Carlos
I solved it using this


you can find all of the commands and usage here:
openfoam30/applications/utilities/mesh/manipulation/topoSet/
There is a file called topoSetDict
Check it out

Regards
Xoitx
Thanks!
--Carlos
martel is offline   Reply With Quote

Old   November 11, 2016, 05:44
Default
  #17
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
Quote:
Originally Posted by Phicau View Post
It asks for word p1, as you have not specified the points:

defaultFieldValues
(
volScalarFieldValue p 0
);

regions
(
cylinderToCell
{
p1 (0 0 0);
p2 (0 0 2.5);
radius 1.25;
fieldValues
(
volScalarFieldValue p 1
);
}
);
Hi, I also same error! :
" keyword p1 is undefined in dictionary cylinderToCell "

I introduced keyword p1 !!!
defaultFieldValues
(
volScalarFieldValue alpha.water 1
);

regions
(
cylinderToCell
{
cylinder
p1 (-0.83261 0.11118 0);
p2 (0.82468 -0.11012 0);
radius 0.03;
fieldValues
(
volScalarFieldValue alpha.water 0
);
}
);

Please help me.
Ali
ebtedaei is offline   Reply With Quote

Old   November 11, 2016, 05:46
Default
  #18
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
Quote:
Originally Posted by libia87 View Post
thanks!!!!!
Hi, I also have same error! :
" keyword p1 is undefined in dictionary cylinderToCell "

I introduced keyword p1 :

defaultFieldValues
(
volScalarFieldValue alpha.water 1
);

regions
(
cylinderToCell
{
cylinder
p1 (-0.83261 0.11118 0);
p2 (0.82468 -0.11012 0);
radius 0.03;
fieldValues
(
volScalarFieldValue alpha.water 0
);
}
);

Please help me.
Ali
ebtedaei 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
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
internal Field BC T.D. OpenFOAM 5 March 14, 2011 05:48
[OpenFOAM] Display internal field together with boundaries gunnar ParaView 4 June 25, 2009 13:00
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


All times are GMT -4. The time now is 09:06.