Easy way to determine if point is in fluid domain?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Meskine
Posts: 26
Joined: Thu Jul 19, 2012 1:56 pm

Easy way to determine if point is in fluid domain?

Post by Meskine »

Hi everybody,

Is there a simple way to determine if a point (x,y,z) is in the fluid domain ?

For example if we have a fluid domain with obstacles (that could be complex), it is difficult to define conditions based on geometrical criteria. Does a simple test exists to determine if we are in or out ?

Does the function findpt give the nearest nodes even if we are outside the domain border ?

Thank you for your help

Meskine
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Easy way to determine if point is in fluid domain?

Post by Yvan Fournier »

Hello,

Currently, findpt will find the closest cell center.

To really determine if a point is inside the mesh, you would need to use the ple_locator_... / fvm_point_location_... functions, which are accessible in the code's C API.

A rewrite of probes using this is planned in the future, but for now, you need to use relatively low-level functions to do this.

The code for the new mapped boundary conditions (in cs_boundary_conditions.c) is probably the simplest example in the whole code using the needed functions, so you may want to take at look at it, in addition to libple/src/ple_locator.h.

Regards,

Yvan
Meskine
Posts: 26
Joined: Thu Jul 19, 2012 1:56 pm

Re: Easy way to determine if point is in fluid domain?

Post by Meskine »

Thank you Yvan for these informations

Regards

Meskine
Post Reply