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

On Wednesday, October 6, 2021 at 8:57:53 PM UTC-7 Wolfgang Bangerth wrote:

>
> > 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: [email protected]
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f7bf9571-8388-4205-86ab-060006cd3594n%40googlegroups.com.

Reply via email to