Actually, from the Users Guide, version 1 page 35...

I think I have an equivalent to the heading

\textbf{What if my term involves the dependent variable, but not
where FiPy puts it? \ }the example there is:\textbf{\ }$\frac{\partial
\phi 
}{\partial t}=\nabla \cdot \left( D_{1}\nabla \phi \right) +\nabla \cdot
\left( D_{2}\phi \nabla \xi \right) $

for me the roughly equivalent equation I think I have is: \
$\frac{\partial
u_{c}}{\partial t}=\nabla \cdot \left( D_{1}u_{c}\nabla u_{c}\right)
+\nabla
\cdot \left( D_{2}u_{c}\nabla \phi \right) $

> Jon Said
> $\nabla \left[ Du_{c}\cdot \nabla u_{c}\right] $ is a
> DiffusionTerm for u_{c}with diffusion coefficient D * uC.

and therefore I solve as. (factoring out $u_{c}$ for only D2)

>>> diffTerm = ImplicitDiffsuionTerm(coeff = D1*uc)
>>> convTerm = PowerLawConvectionTerm(coeff = D2*phase.getFaceGrad(), 
                                                        diffusionTerm =
diffTerm)
>>> eq = TransientTerm() == diffTerm + convTerm

If you can, please confirm that I've got this right so I can
confidently go to look elsewhere for a problem (since implimenting this
does
not give me a good solution yet).

Thanks so much for your patience. \ 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Damm, Edward F.
(E. Buddy)
Sent: Saturday, May 27, 2006 11:38 AM
To: Multiple recipients of list
Subject: RE: ??convection coefficent?? a function of concentration


Jon,

I think what you are saying is that I do not have a convection term here
at all.

My equation is $\frac{\partial u_{c}}{\partial t}=\nabla \left[ D\cdot
\nabla u_{c}+u\cdot \nabla \phi \right] $

OR, $\frac{\partial u_{c}}{\partial t}=\nabla \left[ D\cdot \nabla
u_{c}+% \vec{u}\phi \right] $, right?

Your started your last note in the context of solving for $u_{c}$ as a
TransientTerm $\frac{\partial u_{c}}{\partial t}.$ I think you stayed
with that context, and therefore your examples never reverted to solving
the TransientTerm $\frac{\partial \phi }{\partial t}.$

>  Jon Said...

>  If you're solving for u_{c}, then:.....\qquad  $\nabla \left[ D\cdot 
> \nabla u_{c}\right] $ is a  DiffusionTerm for u_{c}with diffusion 
> coefficient D.

Great, that is precisely my first term. I should factor out a conanical
$% u_{c}$ in $D$ and solve it like a diffusionTerm, Right?

>  $\nabla \cdot \left[ \vec{v}u_{c}\right] $ is a  ConvectionTerm for 
> u_{c}with velocity coefficient v.

That is NOT what I have in my second term!


>  $\nabla \cdot \left[ \vec{v}\phi \right] $ isn't a  ConvectionTerm 
> for u_{c}at all.

Ah, that \emph{IS} what I have, and I've been trying to solve it as a
convection term. \ I should stop trying to solve it as a convection term
and instead solve it as ???? \ what, a source term perhaps? \ If so, I
do not factor out the $u_{c}$ in $\vec{v}$, right?

Buddy

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Guyer
Sent: Friday, May 26, 2006 4:19 PM
To: Multiple recipients of list
Subject: Re: convection coefficent a function of concentration



On May 26, 2006, at 2:51 PM, Damm, Edward F. (E. Buddy) wrote:

>
>
> All the examples you gave had the gradient term expressed as the field

> variable you are solving for in the transientTerm.  There were no 
> mixed gradient terms with respect to the transientTerm, so I'm still a

> little fuzzy.  I may be oversimplifying here.
>
> If I have the equation $\frac{\partial u_{c}}{\partial t}=\nabla 
> \left[ D\cdot \nabla u_{c}+u\cdot \nabla \phi \right] $
>
> Here transient term is solving for the Field variable $u$_{c}.
>
> The first gradient term is in $u_{c}$, so I do Not factor out $u_{c}$
>
> The second gradient term is in $\phi $, so now I do need to factor out

> $% u_{c}.$  With that done, I then have...

It has nothing to do with where the gradient is. Each term implicitly
contains the solution variable in one particular location, so you should
never include this *implicit* solution variable in the coefficient for
that term. That would be redundant. You have to figure out which
canonical Term is represented by each part of your equation. Once you
know that, then look where the solution variable appears in that Term
and everything *else* is the coefficient.

If you're solving for u_c, then:

$\frac{\partial u_{c}}{\partial t}$ is a TransientTerm for u_c with
coefficient 1.
$\frac{\partial \rho_0 u_{c}}{\partial t} is a TransientTerm for u_c
with coefficient rho0.
$\frac{\partial \rho_0 u_{c} u_{c}}{\partial t} is a TransientTerm for
u_c with coefficient rho0 * uC.
$\frac{\partial \phi}{\partial t} isn't a TransientTerm for u_c at all.


$\nabla^2 u_c$ is a DiffusionTerm for u_c with diffusion coefficient 1.
$\nabla \left[ D \cdot \nabla u_c \right]$ is a DiffusionTerm for u_c
with diffusion coefficient D.
$\nabla \left[ D u_c \cdot \nabla u_c \right]$ is a DiffusionTerm for
u_c with diffusion coefficient D * uC.
$\nabla \left[ D \cdot \nabla \phi \right]$ isn't a DiffusionTerm for
u_c at all.


$\nabla\cdot\left[ (1,0,0) * u_c \right]$ is a DiffusionTerm for u_c
with velocity coefficient (1,0,0) (in 3D).
$\nabla\cdot\left[ \vec{v} u_c \right]$ is a ConvectionTerm for u_c with
velocity coefficient v.
$\nabla\cdot\left[ \vec{v} * (1 - u_c) u_c \right]$ is a ConvectionTerm
for u_c with velocity coefficient v * (1 - uC).
$\nabla\cdot\left[ \vec{v} \phi \right]$ isn't a ConvectionTerm for u_c
at all.


A convection term is a convection term because it looks like the
divergence of u_c times *some* velocity vector. It doesn't matter if
that velocity vector has a gradient in it. It doesn't matter if the
velocity vector is *also* a function of u_c.

A diffusion term is a diffusion term because it looks like the
divergence of some diffusivity times the gradient of u_c. It doesn't
matter if the diffusivity also has u_c in it.


Maybe this is the source of your confusion: Arguably, if you had a term

$\nabla\cdot\left[ u_c \nabla u_c \right]$

you could think of this as a DiffusionTerm with a diffusion coefficient
uC *or* as a ConvectionTerm with a velocity coefficient
uC.getFaceGrad(). While this may be technically true, I would never
treat it as a ConvectionTerm, and I don't even know if it would work at
all. Maybe Daniel can confirm.



-----------------------------------------
This message and any attachments are intended for the individual or
entity named above. If you are not the intended recipient, please do not
forward, copy, print, use or disclose this communication to others; also
please notify the sender by replying to this message, and then delete it
from your system. The Timken Company / The Timken Corporation







Reply via email to