# Need nearest distance between a block and a boundary #3964

Closed
opened this Issue Sep 28, 2014 · 8 comments

Projects
None yet
3 participants

### lw4992 commented Sep 28, 2014

 GeometricSearch can find nearest distance between two boundaries, is it possible to find nearest distance from a block to a boundary? Some simulation required this information.
Member

### permcody commented Sep 28, 2014

 Don't blocks always have boundaries? Even if they aren't explicit? You could always add extra boundaries on the fly. MOOSE has several objects for that task. Cody Sent from my iPhone On Sep 28, 2014, at 4:23 AM, lw4992 notifications@github.com wrote: GeometricSearch can find nearest distance between two boundaries, is it possible to find nearest distance from a block to a boundary? Some simulation required this information. — Reply to this email directly or view it on GitHub.
Contributor

### friedmud commented Sep 28, 2014

 Can you describe what you're trying to do a bit more? Do you need the distance between every node in a block and a boundary? Derek On Sunday, September 28, 2014, lw4992 notifications@github.com wrote: GeometricSearch can find nearest distance between two boundaries, is it possible to find nearest distance from a block to a boundary? Some simulation required this information. — Reply to this email directly or view it on GitHub #3964. Sent from my iPhone

### lw4992 commented Sep 29, 2014

 @friedmud, I'm working on the turbulence model of CFD using moose. This model need the nearest distance from every node of fluid to wall boundary. We can image the distance as an AuxVariable of a block. It is similar with the nearest distance between two boundaries of GeometricSearch.

Member

### permcody commented Sep 29, 2014

 This is doable, but isn't currently available in the Geometric search system.
Contributor

### friedmud commented Sep 29, 2014

 I wonder if there could be a way to "fake" it.... by creating a "boundary" that includes all of the nodes in a block. Let me try real quick... On Mon, Sep 29, 2014 at 11:44 AM, Cody Permann notifications@github.com wrote: This is doable, but isn't currently available in the Geometric search system. — Reply to this email directly or view it on GitHub #3964 (comment).

### friedmud added a commit to friedmud/moose that referenced this issue Sep 29, 2014

``` try to use the gometric search system to give us the distance between… ```
`… all nodes in a block and a boundary refs idaholab#3964`
``` 4484e70 ```

Merged

Contributor

### friedmud commented Sep 29, 2014

 Ok - this works. Take a look at #3966 I added a test that has a Mesh in it that includes a Nodeset that has every node in a block in it... then I use both NearestNodeDistanceAux and PenetrationAux to compute the distance to a boundary of that block for each node. (Note that PenetrationAux will give you a perpendicular projection to the boundary... ie the shortest distance where NearestNodeDistanceAux gives you the smallest distance to any Node on a boundary... for this simple test case these two things amount to the same thing) There is only one downside to this approach: it doesn't work with Adaptivity. The Nodeset won't be updated when the Mesh adapts... So... we do still need a better (more general) interface for doing this. But at least @lw4992 can get started using this method... One more note: always remember to number your nodesets completely distinctly from your sidesets! Note that in the Mesh file my sidesets are 1 and 2 and my nodeset is 100 to make sure it doesn't collide with the sideset. This is always true with MOOSE but I just thought I would remind you here!

### lw4992 commented Oct 7, 2014

 Thanks @friedmud, it is what I need. Expect the better version doing this.
Member

### permcody commented Sep 5, 2017

 Closed by #3966.