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

Assigning objects to cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2011, 05:35
Default Assigning objects to cells
  #1
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
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: 14
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 Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
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


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
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03:23
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43
physical boundary error!! kris Siemens 2 August 3, 2005 00:32


All times are GMT -4. The time now is 12:38.