Re: [deal.II] step-22 partial boundary conditions

2017-12-18 Thread Wolfgang Bangerth


right so in the Stokes subsystem of my equations, in simplified form I am 
trying to solve:


div tau - grad p = rhs1
div v = rhs2
where my tau is 2 epsilon as in step-22



The boundary conditions I now want to implement to solve the 'real' problem is:
on the sides (boundary 0): zero tangential stress and no normal flux, so we 
have v dot n = 0 and n.(-pI + tau)t = 0.


Here, you would use VectorTools::compute_no_normal_flux_constraints(), which 
takes care of the v.n=0 condition. The tangential stress would lead to an 
additional term in the right hand side of the weak form, but because it's 
zero, there is nothing additional you need to do.


at the top (boundary 1): zero tangential stress and prescribed normal 
component of normal stress, so that n.(-pI+tau)n= top stress value,
and similarly, on the bottom (boundary 2): zero tangential stress and 
prescribed normal component of normal stress, so that n.(-pI+tau)n= bottom 
stress value.


n and t here are the normal and tangential vectors relative to the surface at 
the respective boundaries, respectively.
The test code works with Dirichlet conditions around the boundary it seems, 
but i need to implement the problem as above.


Since the last message, I realised that I can just expand n.(-pI+tau) into 
normal and tangential components, which means that for the above real problem, 
I can just implement Neumann conditions with top stress value*normal vector to 
the surface, as the tangential stress are zero and therefore in the 
expansions, just simply equal zero. ie. I have n.(-pI+tau) = 
stress_value*normal vector. This is for the top and bottom boundaries.


Yes, exactly -- normal and tangential stress are just two components of one 
vector, and they can be treated together exactly as you suggest.



I am now having a small issue with this, and tried to look up more information 
about fe_face_values, but I am a little stuck.

I am doing (eg. for boundary id 1, and i have the same for 2):

 for (unsigned int face_number=0; 
face_numberface(face_number)->at_boundary()
   &&
   (cell->face(face_number)->boundary_id() == 1))
 {
  fe_face_values.reinit (cell, face_number);
  for (unsigned int q_point=0; q_point')


Here, local_rhs(i) is just a number (double) whereas the compiler tells you 
that the right hand side is a Tensor<1,2>. I suspect that's because you 
declare 'topstress' as a Tensor<2,2>? If so, the expression on the right would be

   Tensor<2,2>
   * Tensor<1,2> // the normal vector
   * double  // shape_value
   * double  // JxW
which obviously is a Tensor<1,2>. I think you forget that the top stress 
should really be just the normal component of the stress (a "force") because 
that's all you can prescribe. In other words, you either need to write this as

  normal_vector * topstress * normal_vector * ...
if you want 'topstress' to be a Tensor<2,2>, or as
  topforce * normal_vector * ...
if you correctly only describe the *force* on the top boundary.

Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] step-22 partial boundary conditions

2017-12-12 Thread Jane Lee
Hi Wolfgang,

right so in the Stokes subsystem of my equations, in simplified form I am 
trying to solve:

div tau - grad p = rhs1
div v = rhs2
where my tau is 2 epsilon as in step-22 
The boundary conditions I now want to implement to solve the 'real' problem 
is:
on the sides (boundary 0): zero tangential stress and no normal flux, so we 
have v dot n = 0 and n.(-pI + tau)t = 0. 
at the top (boundary 1): zero tangential stress and prescribed normal 
component of normal stress, so that n.(-pI+tau)n= top stress value,
and similarly, on the bottom (boundary 2): zero tangential stress and 
prescribed normal component of normal stress, so that n.(-pI+tau)n= bottom 
stress value.

n and t here are the normal and tangential vectors relative to the surface 
at the respective boundaries, respectively. 
The test code works with Dirichlet conditions around the boundary it seems, 
but i need to implement the problem as above.

Since the last message, I realised that I can just expand n.(-pI+tau) into 
normal and tangential components, which means that for the above real 
problem, I can just implement Neumann conditions with top stress 
value*normal vector to the surface, as the tangential stress are zero and 
therefore in the expansions, just simply equal zero. ie. I have n.(-pI+tau) 
= stress_value*normal vector. This is for the top and bottom boundaries.
 For the sides, I use no_normal_flux_constraints in vectortools.
This means that I can indeed implement the boundary condition in the weak 
form of my equation. 

I am now having a small issue with this, and tried to look up more 
information about fe_face_values, but I am a little stuck. 
I am doing (eg. for boundary id 1, and i have the same for 2):

for (unsigned int face_number=0; 
face_numberface(face_number)->at_boundary()
  &&
  (cell->face(face_number)->boundary_id() == 1))
{
 fe_face_values.reinit (cell, face_number);
 
 for (unsigned int q_point=0; q_point')
I understand that the condition is on all velocities and pressure, not just 
the velocities, so I didn't use a component mask or similar. 
In the case of the mixed formulation like this one, how am I supposed to be 
extracting the normal vector correctly in a way I am applying it to the 
whole system?

I hope that makes it clearer!
Thanks for your help again. 



On Monday, December 4, 2017 at 9:17:20 PM UTC+1, Wolfgang Bangerth wrote:
>
>
> Jane, 
>
> > I get that the stress boundary can be put into the weak form, but only 
> > really when you have Neumann conditions. 
>
> Correct, but prescribing the stress in an elasticity problem is exactly 
> a Neumann boundary condition. 
>
>
> > And why would I have to use a 
> > compute_nonzero_normal_flux for a zero one? 
>
> I thought you had a nonzero displacement/velocity on parts of the 
> boundary? If it is zero, then of course you would want to use a 
> different function. 
>
>
> > I believe it my have been my fault not being clearer. 
> > 
> > On the 'side' boundaries, I have no normal flux. 
> > On the other boundaries, I have a prescribed nonzero inhomogeneous 
> > normal component of the normal stress (so this is only one of the 
> > components). 
> > On all boundaries, I have zero tangential stresses (which sorts out the 
> > other 2 components in 2D in additions to the normal component conditions 
> > from the above). 
>
> Can you just put that into formulas, to make things really clear? State 
> the equations you want to solve and for each type of boundary what 
> conditions hold there. 
>
> Maybe that would make it easier for everyone to understand what the 
> other side is saying :-) 
>
>
> > Pardon my potential ignorance, but I'm unsure how I can put these in the 
> > weak form when i have component-wise conditions (partial conditions). 
> > I had thought to use compute_no_normal_flux_constraints for the side 
> > boundaries and compute_nonzero_normal_flux_constraints for the other two 
> > as constraints, but this doesn't seem to work. 
>
> Be specific here as well: what doesn't work? Do you get an assertion, or 
> a wrong solution, or a compiler error, ...? 
>
> Best 
>   W. 
>
> -- 
> 

Re: [deal.II] step-22 partial boundary conditions

2017-12-04 Thread Wolfgang Bangerth


Jane,

I get that the stress boundary can be put into the weak form, but only 
really when you have Neumann conditions.


Correct, but prescribing the stress in an elasticity problem is exactly 
a Neumann boundary condition.



And why would I have to use a 
compute_nonzero_normal_flux for a zero one?


I thought you had a nonzero displacement/velocity on parts of the 
boundary? If it is zero, then of course you would want to use a 
different function.




I believe it my have been my fault not being clearer.

On the 'side' boundaries, I have no normal flux.
On the other boundaries, I have a prescribed nonzero inhomogeneous 
normal component of the normal stress (so this is only one of the 
components).
On all boundaries, I have zero tangential stresses (which sorts out the 
other 2 components in 2D in additions to the normal component conditions 
from the above).


Can you just put that into formulas, to make things really clear? State 
the equations you want to solve and for each type of boundary what 
conditions hold there.


Maybe that would make it easier for everyone to understand what the 
other side is saying :-)



Pardon my potential ignorance, but I'm unsure how I can put these in the 
weak form when i have component-wise conditions (partial conditions).
I had thought to use compute_no_normal_flux_constraints for the side 
boundaries and compute_nonzero_normal_flux_constraints for the other two 
as constraints, but this doesn't seem to work.


Be specific here as well: what doesn't work? Do you get an assertion, or 
a wrong solution, or a compiler error, ...?


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] step-22 partial boundary conditions

2017-12-04 Thread Jane Lee
Hi Wolfgang,

Apologies but could you just clarify?

I get that the stress boundary can be put into the weak form, but only 
really when you have Neumann conditions. And why would I have to use a 
compute_nonzero_normal_flux for a zero one?

I believe it my have been my fault not being clearer. 

On the 'side' boundaries, I have no normal flux. 
On the other boundaries, I have a prescribed nonzero inhomogeneous normal 
component of the normal stress (so this is only one of the components). 
On all boundaries, I have zero tangential stresses (which sorts out the 
other 2 components in 2D in additions to the normal component conditions 
from the above).

I believe this is equivalent to the 4th condition mentioned in step-22. 

Pardon my potential ignorance, but I'm unsure how I can put these in the 
weak form when i have component-wise conditions (partial conditions). 
I had thought to use compute_no_normal_flux_constraints for the side 
boundaries and compute_nonzero_normal_flux_constraints for the other two as 
constraints, but this doesn't seem to work.


On Friday, December 1, 2017 at 11:48:07 PM UTC, Wolfgang Bangerth wrote:
>
>
> Jane, 
>
> > The whole point of not imposing zero for all components in a Dirichlet 
> > sense is that I am testing for a case where I have inhomogeneous normal 
> > component of the normal stress, with the tangential stress being zero on 
> > some boundaries. 
>
> This case is easy: the stress is only imposed weakly anyway, so you need 
> to put this into the bilinear form. 
>
>
> > On some boundaries, I have zero normal flux and zero 
> > tangential stress but I'm pretty sure this doesn't amount to the actual 
> > components being zero anyway. 
>
> Correct. In this case, all you need to do is impose a nonzero normal 
> flux (for which I believe there is a function); the tangential stress 
> would have to be imposed in the bilinear form, but since it's zero there 
> is nothing to do (the term one would have to add to the bilinear form 
> just happens to be zero). 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@colostate.edu 
>  
> 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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] step-22 partial boundary conditions

2017-12-01 Thread Wolfgang Bangerth


Jane,

The whole point of not imposing zero for all components in a Dirichlet 
sense is that I am testing for a case where I have inhomogeneous normal 
component of the normal stress, with the tangential stress being zero on 
some boundaries.


This case is easy: the stress is only imposed weakly anyway, so you need 
to put this into the bilinear form.



On some boundaries, I have zero normal flux and zero 
tangential stress but I'm pretty sure this doesn't amount to the actual 
components being zero anyway.


Correct. In this case, all you need to do is impose a nonzero normal 
flux (for which I believe there is a function); the tangential stress 
would have to be imposed in the bilinear form, but since it's zero there 
is nothing to do (the term one would have to add to the bilinear form 
just happens to be zero).


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] step-22 partial boundary conditions

2017-11-29 Thread Jane Lee
Hi Wolfgang, thank you for your reply. 

I've had another look at the functions available and i'm stuck on how to 
implement these in this case. 

The whole point of not imposing zero for all components in a Dirichlet 
sense is that I am testing for a case where I have inhomogeneous normal 
component of the normal stress, with the tangential stress being zero on 
some boundaries. On some boundaries, I have zero normal flux and zero 
tangential stress but I'm pretty sure this doesn't amount to the actual 
components being zero anyway.

Can you suggest a way to implement this if I algorithmically, what I was 
doing previously wouldn't work?

Thank you - I will keep having a look mathematically if there is some 
manipulation I might be able to do. 

Many thanks

On Monday, November 27, 2017 at 10:53:14 PM UTC, Wolfgang Bangerth wrote:
>
> On 11/27/2017 01:16 PM, Jane Lee wrote: 
> > I'm trying to apply some partial boundary conditions to the step-22 
> > stokes problem. I can't seem to find much further help on this and when 
> > I try and implement it, it solves but solution is clearly unstable/blows 
> > up. 
> > 
> > I am trying the basics before i impose inhomogeneous quantities, and 
> > using no normal flux on the boundary, which constrains one component, 
> > and then allow no tangential stresses either, which should constrain the 
> > other two. Can anyone spot where I'm going wrong? 
>
> I don't think you can do it that way -- this would constrain the normal 
> component in terms of the tangential components, and then somehow try to 
> find a coordinate system in which to constrain the tangential 
> components, but I can completely see how this leads to circular 
> dependencies and all sorts of other weirdness. If you want a zero 
> boundary condition, then just impose zero for all components. 
>
> I'll add that *theoretically* things should work this way -- you are 
> constraining all components. But *algorithmically*, I don't think that's 
> a useful approach. 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@colostate.edu 
>  
> 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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] step-22 partial boundary conditions

2017-11-27 Thread Wolfgang Bangerth

On 11/27/2017 01:16 PM, Jane Lee wrote:
I'm trying to apply some partial boundary conditions to the step-22 
stokes problem. I can't seem to find much further help on this and when 
I try and implement it, it solves but solution is clearly unstable/blows 
up.


I am trying the basics before i impose inhomogeneous quantities, and 
using no normal flux on the boundary, which constrains one component, 
and then allow no tangential stresses either, which should constrain the 
other two. Can anyone spot where I'm going wrong?


I don't think you can do it that way -- this would constrain the normal 
component in terms of the tangential components, and then somehow try to 
find a coordinate system in which to constrain the tangential 
components, but I can completely see how this leads to circular 
dependencies and all sorts of other weirdness. If you want a zero 
boundary condition, then just impose zero for all components.


I'll add that *theoretically* things should work this way -- you are 
constraining all components. But *algorithmically*, I don't think that's 
a useful approach.


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.