Thanks for all the help Jennifer and to everyone else for the help 
with questions.

>>> Jennifer Worthen <[email protected]> 11/20/10 3:09 PM >>>
Dan,

> I ran a simulation with Dirchlet conditions on the entire boundary.  The
> error on the velocity looks okay, but the error on the pressure does
not. 
> I understand that, due to the Dirichlet conditions, the pressure may be
off
> by a constant but the pressure gradient should be correct.  According to
> the exact solution, the pressure drop should be 4 over the length of the
> channel in the x-direction.  But according to the .vtk output files, the
> pressure gradient is not correct and the pressure drop is actually only
2. 
> I was wondering if anybody could help.  In step-22 I noticed that the
> definition of the symmetric gradient has a coefficient of 1/2 in front
and
> I was wondering if this is the problem ( assuming that my code is not :)
).
> 
> 
> Multiplying the first term of the weak form (the symmetric gradient
> product) of step-22 by 2 seems to fix the pressure gradient problem, but
I
> would have thought both symmetric gradients would have to be multiplied
by
> 2 (for this problem to make sense).       

The problem might be in your weak form; I've had a similar (if not the
same) 2 error before. A single 1/2 comes from changing the gradient of the
test function in the weak form to the symmetric gradient of the test
function, i.e.

grad phi : (grad u + (grad u)^T) = 1/2 (grad phi + (grad phi)^T): (grad u
+ (grad u)^T).

Then, with the definition of a 1/2 in the symmetric gradient, you end up
with a 2 in your weak form.
 
> 2) My second question is concerning using a constraint matrix to enforce
> the mean-value pressure on the outflow to be 0.  I have followed the
steps
> in tutorial 11 and tried to apply them to step-22 for this problem, but
am
> having an error with the "condense" command (I think).  Namely,
> 
> 
> An error occurred in line <2259> of file
> </home/dbrauss/Desktop/programs/deal.II/lac/include/lac/sparse_matrix.h>
in
> function
>     void dealii::SparseMatrix<number>::add(unsigned int, unsigned int,
>     number) [with number = double]
> The violated condition was:
>     (index != SparsityPattern::invalid_entry) || (value == 0.)
> The name and call sequence of the exception was:
>     ExcInvalidIndex(i, j)
> Additional Information:
> The entry with index <138,25> does not exist.

This error is telling you that it's trying to add an entry to a sparse
matrix where you've told it not to have entries (by the sparsity pattern).
When you enforce anything on the pressure, it's going to change entries in
the (2,2) block of the Stokes matrix, but according to the sparsity
pattern, there are only supposed to be values in the other three blocks.
You can change the sparsity pattern to reflect your additional constraints,
or what I've done instead is to subtract the mean value of the pressure at
the end of the solve using compute_mean_value before I go to
output_results. Then I don't have to change the sparsity pattern, and the
subtracted value is usually very small (i.e. the pressure hasn't blown up
during the solve for me).

Jennifer

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

Reply via email to