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

Duplicate and sort a patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2024, 13:51
Default Duplicate and sort a patch
  #1
Member
 
MC
Join Date: Apr 2021
Posts: 43
Rep Power: 5
MarcoC501 is on a distinguished road
Hello,

I just started programming in OpenFOAM and, as exercise, I wanted to develop radial equilibrium boundary conditions on a given patch.

To this scope, I first converted the cartesian coordinates to cylindrical coordinates and make some operations to obtain the tangential velocity component. My mesh is structured and follows the annulus profile (this simplifies the implementation...)

However, to apply the radial equilibrium I need to have sorted coordinates (from min to max radius), so it is easier to store everything in a matrix N_radius x N_theta (where N_radius and N_theta are the number of radial and tangential positions).

I think the best idea is to copy the patch, sort it, apply the radial equilibrium, and then interpolate back on the non-sorted grid.

I think I can handle the interpolation, I just need to find a quick way for duplicate and sort the patch and the related flow fields. I could not find examples on how to do that, and I would like to know if you could help me (or give good references) on how I could do this implementation using existing OpenFOAM syntax and programming logic.

Thanks a lot for your help
MarcoC501 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
fvDOM OpenFOAM wedge type patch jaydeep OpenFOAM Running, Solving & CFD 3 January 27, 2021 02:48
Changing viewfactor Model and use the changed my model by calling "mySolver" FabianF OpenFOAM Programming & Development 2 January 14, 2014 11:25


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