On 12/10/2016 05:18 PM, Lailai Zhu wrote:

I started everything from the step-31, Stokes equations solving vector
field 'u' and scalar field 'p', and a temperature equation for 'T'.

My problem is similar to this, namely I have a scalar field, say 'C', 'C'
is an explicit function of 'u' and 'p' (for example C=(\nabla u : \nabla u)
- p ), so i don't need to use fem to solve for 'C' like the example 31
solving for 'T'.  'C' can be directly expression by 'u' and 'p'.

I would like to use 'C' a lot as intermediate variable (for example to
help define the volume force of the momentum equations), so I need to know
'C' at every quadrature points. I also want to export 'C' in the .vtk
output.

My question is what be the most reasonable or efficient way to define and
calculate such 'C'. Do I need to define 'C' as a solution variable, exactly
like 'T' even I don't really need to solve for it? Thanks in advance,

The answer is different for the two contexts. For creating output in a .vtk file, you will want to compute the quantity in a postprocessor derived from DataPostprocessor. There are a number of tutorial programs that show how to do this.

On the other hand, if you need this quantity in the assembly of another equation, then you will want to compute it at the quadrature points you care about, whenever that is necessary. That is no different than using the previous solution to define the coefficient in the current iteration in a nonlinear scheme. You probably want to look at step-15 to see how to do this.

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.

Reply via email to