Hi Javier

If you write down the weak form of the governing equation, apply the divergence 
theorem, substitute the flux on the boundary in terms of the convective 
boundary condition you will see that the unknown temperature on the boundary 
enters directly into the problem. In other words, the convective cooling 
condition adds additional terms to the bilinear form. The unknown temperature 
is included in a term that resembles a mass matrix on the surface while the 
external temperature acts as a contribution to the right hand side.

The derivation is given in a lot of fem text books; see e.g. pg 35 of JN 
Reddy's book: An introduction to nonlinear fem analysis

Cheers
Andrew


On 04.11.2011, at 22:04, Javier Muñoz wrote:

> Hi
> 
> I've been working and studying deal.ii for 3 or 4 months. So far I been
> able to set up a simple time dependent model of heat diffusion with free
> and fixed boundary conditions. I also was able to establish material
> properties based on material id's.
> 
> My question might be very simple. I want to set up a function to
> calculate the heat flux in the surface based on a given 'external
> temperature' (read from a external file) and the temperature over that
> surface (i.e. newtons law of cooling). Based on step 7 I have this piece
> of code:
> 
> typename DoFHandler<dim>::active_cell_iterator 
>   cell = dof_handler.begin (),
>   endc = dof_handler.end ();
>     for (;cell != endc; ++cell)
>       {
>        cell_rhs = 0;
>        for (unsigned int face = 0;
>            face<GeometryInfo<dim>::faces_per_cell;
>             ++face)
>            if (cell->face(face)->at_boundary()
>                &&
>               (cell->face(face)->boundary_indicator () == 2))
>                    {
>                   fe_face_values.reinit (cell,face);
>                   for (unsigned int q_point = 0;
>                         q_point < n_face_q_points;
>                         ++q_point)
>                         {
>                         const double neumann_value 
>                              = 'problematic-function';
>                         for (unsigned int i = 0;
>                               i < dofs_per_cell;
>                               ++i)
>                                 cell_rhs (i) += (neumann_value *
>                                 fe_face_values.shape_value(i,q_point)*
>                                 fe_face_values.JxW (q_point));
>                         }
>                    }     
>             cell -> get_dof_indices (local_dof_indices);
>             for (unsigned int i = 0; i<dofs_per_cell; ++i)
>                 {
>                  system_rhs(local_dof_indices [i]) += cell_rhs (i);
>                 } 
>       }
> 
> Here I'm trying to establish the neumann boundary condition but in order
> to determine the heat flux I need to know the value of temperature over
> the face. Are these values the degrees of freedom over the surface? If
> so, can I obtain them using get_dof_values (although I don't know
> exactly how)?
> 
> I'll appreciate any clue you could give me.
> 
> Regards
> Javier Muñoz
> 
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to