VectorTools::compute_nonzero_normal_flux_constraints on inner boundary and rientrant corners

34 views
Skip to first unread message

Giovanna Bucci

unread,
Oct 5, 2021, 4:39:21 PM10/5/21
to deal.II User Group
Hello,

I am trying to apply VectorTools::compute_nonzero_normal_flux_constraints to the points on the inner boundary of a plate with a hole to move them by the same amount in the direction of the outward normal (basically to make the hole shrink).

I ran a test with a circular hole and a square hole. In both case I didn't get what I expected  (see images attached).

Eventually, I need to solve the problem on an irregular inner boundary so I am looking for a robust method.

I copied below the code. I very much appreciate any help with this.

Thank you
Giovanna

- - - - - - - - - -
 std::set<types::boundary_id> normal_flux_boundaries;
 std::map<types::boundary_id, const Function<dim> *> boundary_functions;
 double velocity = 0.005;
  Functions::ConstantFunction<dim, double>  constant_velocity(velocity,numVariables);

  normal_flux_boundaries.insert (Internal_boundary);
  boundary_functions.insert({Internal_boundary, &constant_velocity});

  VectorTools::compute_nonzero_normal_flux_constraints    ( dof_handler,
                              0,                       //  first_vector_component,
                              normal_flux_boundaries,
                              boundary_functions,
                              constraints,
                              StaticMappingQ1< dim >::mapping
                              );
squareHole.png
circularHole.png

Wolfgang Bangerth

unread,
Oct 6, 2021, 11:57:53 PM10/6/21
to dea...@googlegroups.com

> I ran a test with a circular hole and a square hole. In both case I didn't get
> what I expected  (see images attached).
>
> Eventually, I need to solve the problem on an irregular inner boundary so I am
> looking for a robust method.
>
> I copied below the code. I very much appreciate any help with this.
>
> Thank you
> Giovanna
>
> - - - - - - - - - -
>  std::set<types::boundary_id> normal_flux_boundaries;
>  std::map<types::boundary_id, const Function<dim> *> boundary_functions;
>  double velocity = 0.005;
>   Functions::ConstantFunction<dim, double>
> constant_velocity(velocity,numVariables);

This corresponds to a vector-valued function equal to
V = (v,v,...,v) // every component is equal to 'velocity'


>   normal_flux_boundaries.insert (Internal_boundary);
>   boundary_functions.insert({Internal_boundary, &constant_velocity});
>
>   VectorTools::compute_nonzero_normal_flux_constraints    ( dof_handler,
>                               0,                       //
> first_vector_component,
>                               normal_flux_boundaries,
>                               boundary_functions,
>                               constraints,
>                               StaticMappingQ1< dim >::mapping
>                               );

And this function then computes the constraints that correspond to ensuring
that the solution's normal component equals
n * V
Because V points diagonally to the top right in your figures, the constraint
is that the normal component is zero whenever 'n' points to the top left or
bottom right, which is exactly what you see in the picture of your square with
a circular hole. In other words, I think it all looks like it should given
what the function is doing :-)

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Giovanna Bucci

unread,
Oct 7, 2021, 12:20:04 PM10/7/21
to deal.II User Group
Thank you, Wolfgang, for your reply.

Now I understand.

Is there a built-in function to apply a velocity field which points in the direction normal to the boundary?
Or I could implement a modified version of the compute_nonzero_normal_flux_constraints function that does that

Kind regards,
Giovanna

Wolfgang Bangerth

unread,
Oct 7, 2021, 1:33:51 PM10/7/21
to dea...@googlegroups.com
On 10/7/21 10:20 AM, Giovanna Bucci wrote:
>
> Is there a built-in function to apply a velocity field which points in
> the direction normal to the boundary?
> Or I could implement a modified version of the
> compute_nonzero_normal_flux_constraints function that does that

I don't think there is such a function. But if you look at how the
function is implemented, it's probably not too complicated to modify it
for your purposes.

Giovanna Bucci

unread,
Oct 7, 2021, 1:45:48 PM10/7/21
to deal.II User Group
I modified the function (it only required changing a few lines of code) and got the result I was hoping for.

Thank you,
Giovanna
plate_shrinkingHole.png
Reply all
Reply to author
Forward
0 new messages