### Advection like equation

88

views

0

Hi there,

I'm working in the following equation

$w\frac{\partial c}{\partial t}-\left(1-c\right)\frac{\partial w}{\partial t}-\frac{\partial\left[\left(1-c\right)v_xw\right]}{\partial x}-\frac{\partial\left[\left(1-c\right)v_yw\right]}{\partial y}=f$

here w is width

I'm working in the following equation

$w\frac{\partial c}{\partial t}-\left(1-c\right)\frac{\partial w}{\partial t}-\frac{\partial\left[\left(1-c\right)v_xw\right]}{\partial x}-\frac{\partial\left[\left(1-c\right)v_yw\right]}{\partial y}=f$

`w`∂`c`∂`t`−(1−`c`)∂`w`∂`t`−∂[(1−`c`)`v`_{x}`w`]∂`x`−∂[(1−`c`)`v`_{y}`w`]∂`y`=`ƒ`here w is width

```
w_frac = Expression('exp(-x[0]-t)',t=0,degree=1)
w_old = Function(V)
w_old = Interpolate(w_frac,V)
w_frac.t = dt
w_new = Function(V)
w_new = Interpolate(w_frac,V)
```

For the velocity I'm using

`vel = Expression(('(1)','(0)'),degree=1,domain=mesh)`

And for the variational form I'm trying```
c = TrialFunction(V)
q = TestFunction(V)
F = w_new*c*q*dx - (1-c)*(w_new-w_old)*q*dx - dot(dot(vel,w_new),grad(1-c))*q*dx - (w_new*c_1+dt*f)*q*dx
a, L = lhs(F), rhs(F)
```

Could you please help me defining a better variational form.

Thank you very much for your guidance!!!

Community: FEniCS Project

Please login to add an answer/comment or follow this question.