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

internalField nonuniform <List>;

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 23, 2010, 11:29
Default internalField nonuniform <List>;
  #1
New Member
 
Andres
Join Date: Apr 2010
Posts: 3
Rep Power: 7
Panagioto is on a distinguished road
Hi everybody!
How do I make the list for
internalField nonuniform
<List>;? this is for the 0/pd directory in interFoam

Panagioto is offline   Reply With Quote

Old   July 14, 2011, 16:05
Default
  #2
New Member
 
Tushar
Join Date: Jun 2011
Location: IIT Kanpur
Posts: 4
Rep Power: 6
tsikroria0 is on a distinguished road
Even I want to implement nonuniform internal fiels for pressure... Can anyone tell me how the cell numbering is set in OpenFOAM?
tsikroria0 is offline   Reply With Quote

Old   August 26, 2011, 14:19
Default
  #3
New Member
 
muhammad El-nashash'ee
Join Date: Aug 2011
Posts: 4
Rep Power: 6
mu.e.nash is on a distinguished road
Quote:
Originally Posted by tsikroria0 View Post
Even I want to implement nonuniform internal fiels for pressure... Can anyone tell me how the cell numbering is set in OpenFOAM?
hi all,
the numbering begin in x-direction then y-direction then z-direction
eg.
//loop for changing z
for(int i=0;i<NocellsZ;i++)
{//loop for changing y
for(int j=0;j<NocellsY;j++)
{//loop for changing x
for(int k=0;k<NocellsX;k++)
{
//put the value here
}
}
}
mu.e.nash is offline   Reply With Quote

Old   August 28, 2011, 18:38
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mu.e.nash View Post
hi all,
the numbering begin in x-direction then y-direction then z-direction
eg.
//loop for changing z
for(int i=0;i<NocellsZ;i++)
{//loop for changing y
for(int j=0;j<NocellsY;j++)
{//loop for changing x
for(int k=0;k<NocellsX;k++)
{
//put the value here
}
}
}
I'm afraid: No. This would work for only a blockMesh with one block (and even there OpenFOAM wouldn't voluntarily give you the NocellsX/Y/Z (it doesn'T know it as this kind of information doesn't make sense for a polyhedral mesh)

@tsikroria0: if you WANT to program it in C++ have a look how utilities like engineSwirl and setFields do it. If you just want to set the field and go on: search for funkySetFields
gschaider is offline   Reply With Quote

Old   August 28, 2011, 19:12
Default
  #5
New Member
 
muhammad El-nashash'ee
Join Date: Aug 2011
Posts: 4
Rep Power: 6
mu.e.nash is on a distinguished road
yes i have tried my code on one block, but i made a c++ program outside OpenFoam to read the output of blockMesh and assign the value of my internal field to the centers of cells by changing the files in "0" directory by using:
internalField nonuniform List<scalar>
'No.ofOverallCells'
(
//data entered here
)
;

if there is another way to doing so for multiple blocks please tell me that way.
mu.e.nash is offline   Reply With Quote

Old   August 30, 2011, 05:52
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mu.e.nash View Post
yes i have tried my code on one block, but i made a c++ program outside OpenFoam to read the output of blockMesh and assign the value of my internal field to the centers of cells by changing the files in "0" directory by using:
internalField nonuniform List<scalar>
'No.ofOverallCells'
(
//data entered here
)
;

if there is another way to doing so for multiple blocks please tell me that way.
Your previous example worked for one block because blockMesh HAPPENS to number cells that way. The pricinciple is extendible for more than one block, but be warned that this might break at any time (if the implementation of blockMesh changes)

For the general case if you don't want to do use the OpenFOAM-API your best guess is to let an OF-program write out the cell centers of the mesh and your program reads that in and acts accordingly
gschaider is offline   Reply With Quote

Old   August 30, 2011, 06:06
Default
  #7
New Member
 
muhammad El-nashash'ee
Join Date: Aug 2011
Posts: 4
Rep Power: 6
mu.e.nash is on a distinguished road
how is that???
mu.e.nash is offline   Reply With Quote

Old   August 30, 2011, 07:29
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mu.e.nash View Post
how is that???
Because OpenFOAM is a code for general polyhdra (I think I invested more time in this vacuous (but correct) answer than you did in the formulation of your question)
gschaider is offline   Reply With Quote

Old   August 20, 2013, 13:06
Default
  #9
Member
 
hekseli
Join Date: Mar 2013
Posts: 38
Rep Power: 4
heksel8i is on a distinguished road
Hey!

I would like to have a nonuniform initial condition. I have a arbitrary boundary and I know the flow values in the boundary cells/faces. Apparently I could use interiorfield: nonuniform and give the values as a list (x,y,z,value). But because I want to start the simulation with these values and the mesh is not created by blockmesh, I have no idea about the order of the list-values in nonuniform condition.

I tried to check but swak4foam and setFields seem to be for analytical expressions but I want to work with a truly existing list?

Any ideas?
heksel8i is offline   Reply With Quote

Old   August 20, 2013, 15:12
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by heksel8i View Post
Hey!

I would like to have a nonuniform initial condition. I have a arbitrary boundary and I know the flow values in the boundary cells/faces. Apparently I could use interiorfield: nonuniform and give the values as a list (x,y,z,value). But because I want to start the simulation with these values and the mesh is not created by blockmesh, I have no idea about the order of the list-values in nonuniform condition.

I tried to check but swak4foam and setFields seem to be for analytical expressions but I want to work with a truly existing list?

Any ideas?
Try timeVaryingMappedFixedValue
__________________
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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
nonuniform velocity at the inlet sambatra OpenFOAM Running, Solving & CFD 5 June 17, 2014 17:39
nonuniform boundary condition( U=f(y) ) ? panda60 OpenFOAM 2 November 5, 2009 13:28
problem with internal field and nonuniform list OFU OpenFOAM Running, Solving & CFD 1 October 5, 2009 03:35
Set nonuniform boundary values nikwin OpenFOAM Running, Solving & CFD 1 November 30, 2008 08:12
Problem with nonuniform boundary conditions qtian OpenFOAM Pre-Processing 2 July 25, 2007 15:30


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