|
[Sponsors] |
Obtain local volume at node/vertex in user routine |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 18, 2016, 05:22 |
Obtain local volume at node/vertex in user routine
|
#1 |
Member
Join Date: Jan 2016
Posts: 34
Rep Power: 10 |
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. |
|
January 18, 2016, 06:14 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Aren't source terms defined as per unit volume? If so then you don't need to adjust for cell volumes.
|
|
January 18, 2016, 06:54 |
|
#3 |
Member
Join Date: Jan 2016
Posts: 34
Rep Power: 10 |
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.
|
|
January 18, 2016, 07:07 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
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.
|
|
January 18, 2016, 07:50 |
|
#5 |
Member
Join Date: Jan 2016
Posts: 34
Rep Power: 10 |
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.
|
|
January 18, 2016, 18:14 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
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. |
|
January 19, 2016, 07:39 |
|
#7 | |
Member
Join Date: Jan 2016
Posts: 34
Rep Power: 10 |
Quote:
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! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
Multiple floating objects | CKH | OpenFOAM Running, Solving & CFD | 14 | February 20, 2019 10:08 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |