CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

FORTRAN coding for AMR

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2014, 15:07
Exclamation FORTRAN coding for AMR
  #1
New Member
 
Harshavardhana Srinivasan
Join Date: Jul 2013
Posts: 5
Rep Power: 12
harshasrini is on a distinguished road
Hello!
I am writing a code to perform Mesh refinement, i have a starcd mesh file (2d), i have written a code where i read the mesh file, i have the cell data and the vertex data read separately and have also defined the neighbours. I want to refine particular area of cells, maybe to create a circle and refine the cells that fall into it... i have also created the circle within the grid, am finding it difficult to write a condition to mark the cells that fall under the circle, it would be great if someone could suggest me a solution for this or any other strategy... Thanks in advance
harshasrini is offline   Reply With Quote

Old   July 23, 2014, 13:59
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear Harshavardhana,

your question is not easy to understand. The only thing which pops up in my mind is that you should check for (quantities in square brackets are optional for 3D):

given the coordinates x, y [, z] of the cell center (or any other relevant cell-related coordinate)
given the coordinates of the circle/sphere center xc, yc [, zc]
given the circle/sphere radius rc

if ((x-xc)^2+(y-yc)^2[+(z-zc)^2]>=rc^2) then
!Point out of the circle/sphere
else
!Point in the circle/sphere
endif

But i hardly think that after all that you did you stopped on this. So, please, elaborate more.
sbaffini is offline   Reply With Quote

Old   July 23, 2014, 14:04
Default
  #3
New Member
 
Harshavardhana Srinivasan
Join Date: Jul 2013
Posts: 5
Rep Power: 12
harshasrini is on a distinguished road
Dear Paolo,
What i want to do now is to just test my algorithm for AMR, i dont have a solution where i can use the truncation error to flag cells for refinement, so am creating a circle within the grid and flagging the cells falling under the circle for refinement. I have created the circle and am stuck on how to flag the cells within the circle now... Or am looking for some-other way to flag cells for refinement..
Thank you.
harshasrini is offline   Reply With Quote

Old   July 23, 2014, 14:40
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,151
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
So, would the check suggested above work in your case? Or have i misunderstood your question?
sbaffini is offline   Reply With Quote

Reply

Tags
fortran code, mesh adaptation, refinementregion


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
Fortran Compiler-CFX12.1 Araz CFX 13 March 27, 2017 05:37
Using Fortran with CFX: How to connect Fortran to CFX? l.te CFX 0 October 21, 2012 11:42
Fortran CFD coding on Macintosh OS 9mile Main CFD Forum 2 August 23, 2009 01:38
visual fortran Monica Main CFD Forum 1 August 28, 2004 20:45
fortran coding for explosion dj CFX 0 September 25, 2003 01:33


All times are GMT -4. The time now is 15:05.