- #1

- 1,782

- 32

- TL;DR Summary
- How can you supply the boundary condition for the conservation of mass to a bar of time-dependent length?

Suppose I'm looking at a bar of length [itex]L(t)[/itex] in 1D and I have the conservation of mass:

[tex]

\frac{\partial\rho}{\partial t}+\frac{\partial}{\partial x}(\rho u)=0

[/tex]

In order to make things easier, I make the change of variable [itex]x'=x/L(t)[/itex] so that in this frame of reference, the length remains constant, and it will keep the numerics easier. The equation is then transformed into:

[tex]

L^{2}(t)\frac{\partial\rho}{\partial t}-L'(t)\frac{\partial\rho}{\partial x'}+\frac{\partial}{\partial x'}(\rho u)=0

[/tex]

Now when I do a method of lines numerical method I end up with the following:

[tex]

\frac{d\rho_{i}}{dt}=\frac{L'}{2hL^{2}}(\rho_{i+1}-\rho_{i-1})-\frac{L}{2h}(\rho_{i+1}u_{i+1}-\rho_{i-1}u_{i-1})

[/tex]

I thought about using the boundary condition:

[tex]

\frac{\partial}{\partial x}(\rho u)=0

[/tex]

but I don't know how to deal with [itex]\partial\rho/\partial x'[/itex] on the boundary. Does anyone know?

[tex]

\frac{\partial\rho}{\partial t}+\frac{\partial}{\partial x}(\rho u)=0

[/tex]

In order to make things easier, I make the change of variable [itex]x'=x/L(t)[/itex] so that in this frame of reference, the length remains constant, and it will keep the numerics easier. The equation is then transformed into:

[tex]

L^{2}(t)\frac{\partial\rho}{\partial t}-L'(t)\frac{\partial\rho}{\partial x'}+\frac{\partial}{\partial x'}(\rho u)=0

[/tex]

Now when I do a method of lines numerical method I end up with the following:

[tex]

\frac{d\rho_{i}}{dt}=\frac{L'}{2hL^{2}}(\rho_{i+1}-\rho_{i-1})-\frac{L}{2h}(\rho_{i+1}u_{i+1}-\rho_{i-1}u_{i-1})

[/tex]

I thought about using the boundary condition:

[tex]

\frac{\partial}{\partial x}(\rho u)=0

[/tex]

but I don't know how to deal with [itex]\partial\rho/\partial x'[/itex] on the boundary. Does anyone know?

Last edited: