CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Obtain local volume at node/vertex in user routine

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By honcho62

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2016, 04:22
Default Obtain local volume at node/vertex in user routine
  #1
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
Hi again

I am assigning momentum to a certain number of nodes in a fluid domain. That momentum needs to be adjusted for how much the volume at that node inhabits the volumes of all nodes that have momentum assigned to them.

I have a FOR/DO loop, in a Fortran User Routine, that assigns these nodes their momentum. So I have been looking for a way to call up the volume that is related to X(ILOC),Y(ILOC),Z(ILOC). However, the routines I can find for Fortran such as USER_GET_MESH_INFO use the counter NVX, referring to total number of vertices. So the question is, are the vertices from that routine arranged the same way as X,Y,Z from ARGS(). Or ILOC = NVX

I know I could also call volcvol in CEL in CFX pre, but I need to know the total sum first, so I don't think it's a good idea to put this in CFX pre as such.
snowquote likes this.
honcho62 is offline   Reply With Quote

Old   January 18, 2016, 05:14
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,708
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Aren't source terms defined as per unit volume? If so then you don't need to adjust for cell volumes.
ghorrocks is offline   Reply With Quote

Old   January 18, 2016, 05:54
Default
  #3
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
That may be so, but you're only applying this force on a small volume within the domain. And this smaller volume consists of several cells, so you'd have to distribute the force over these cells in a way that it would be a singular cell. It's not so much about dimension, more about fraction.
honcho62 is offline   Reply With Quote

Old   January 18, 2016, 06:07
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,708
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
So if you get the total volume of the source from a CEL expression then you can get the per unit volume source and apply it as a constant source term.
ghorrocks is offline   Reply With Quote

Old   January 18, 2016, 06:50
Default
  #5
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
Pretty much, so I need an equivalent Volume term for X(ILOC) etc that I can use in Fortran, the subroutine that I mentioned seems useful but it uses a different counter so I'm not sure if for the same index they refer to the same vertex.
honcho62 is offline   Reply With Quote

Old   January 18, 2016, 17:14
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,708
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
If you have not already guessed, I am not very familiar with fortran in CFX so cannot directly answer your question. Maybe somebody else on the forum knows CFX fortran better than I and can answer your question.

But maybe my alternate approach can work - if you calculate the total volume as a CEL expression, then access that variable in fortran you can calculate the total volume that way.
ghorrocks is offline   Reply With Quote

Old   January 19, 2016, 06:39
Default
  #7
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
If you have not already guessed, I am not very familiar with fortran in CFX so cannot directly answer your question. Maybe somebody else on the forum knows CFX fortran better than I and can answer your question.

But maybe my alternate approach can work - if you calculate the total volume as a CEL expression, then access that variable in fortran you can calculate the total volume that way.
I'm aware, but thanks for all the help anyway. I put the post up there in the hope someone would know.

That might be a solution, but only if you can hold of the calculation of the force until it's done with the volume expression. I'll try it out, thanks!
honcho62 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42


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