CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Assigning objects to cells

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 9, 2011, 05:35
Default Assigning objects to cells
  #1
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hi

I want to develop a class that defines material behaviour for a stress analysis solver. I need to assign an object to each finite volume.

Also, I need to extract numerical values from tensor/vector/scalar field (for each cell), use them inside the object functions then return these values to a variable field (a tensor field) (during the time step loop).

How is it possible to loop the control volumes?

I would appreciate it if I get help on how to do that or where to look for answers.

Thanks
Hisham is offline   Reply With Quote

Old   August 9, 2011, 14:30
Default
  #2
New Member
 
Join Date: Aug 2011
Posts: 6
Rep Power: 5
gunnar2 is on a distinguished road
Hello Hisham,
I am not sure if I understand your question.

This should work:

Quote:
YourObjectType someValue;
GeometricField< YourObjectType, fvPatchField, fvMesh > field=...;
for (int i=0;i<field.size();i++){
field[i]=someValue;
}
HTH
Gunnar
gunnar2 is offline   Reply With Quote

Old   August 17, 2011, 10:32
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Thanks a lot for your reply

Can you elaborate more or at least, can you guide me to where I can learn more
Hisham is offline   Reply With Quote

Reply

Tags
objects to cells

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
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
snappyHexMesh aborting Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 0 November 10, 2010 04:23
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
physical boundary error!! kris CD-adapco 2 August 3, 2005 00:32


All times are GMT -4. The time now is 21:14.