Boundary conditions for variable length bar

In summary: I think...In summary, we are considering a bar of length L(t) in 1D with conservation of mass given by \frac{\partial\rho}{\partial t}+\frac{\partial}{\partial x}(\rho u)=0. To make things easier, we make the change of variable x'=x/L(t) so that the length remains constant and the numerics are easier. However, this transformation leads to a boundary condition of \frac{\partial\rho}{\partial t}-\frac{x'L'(t)}{L}\frac{\partial\rho}{\partial x'}+\frac{1}{L}\frac{\partial}{\partial x'}(\rho u)=0, which is problematic at the boundaries
  • #1
hunt_mat
Homework Helper
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?
 
Last edited:
Physics news on Phys.org
  • #2
Isn't ##\rho = 0## at the boundary? That's where your bar ends.
 
  • #3
Wouldn't that simply be the value of [itex]\rho[/itex] at [itex]x'=0^{-},1^{+}[/itex]?
 
  • #4
I think so. Wouldn't your difference equation then be solvable given an initial mass and velocity distribution at ##t=0##?

I'm assuming there is no bar outside of the interval ##[0,1]##
 
  • #5
I'm a little confused as to what you're saying, to put everything into ode45, you need to include the terms at [itex]i=1[/itex] and [itex]i=N[/itex] which means that you have to use ghost cells [itex]\rho_{0}[/itex] and [itex]\rho_{N+1}[/itex] which you normally find from the boundary conditions, I don't kbnow how to deal with [itex]\rho[/itex] by itself.
 
  • #6
Let's pull back a bit. Both ##\rho## and ##u## depend on both ##t## and ##x##. What you start with is an equation of conservation. Given ##u(t,x)## for all time one could in principle compute ##\rho(t,x)##, which is where the mass density moves to by solving the differential equation. I don't see any equations that determine ##u##?
 
  • #7
Let me spell out my issue in a little more detail. Make both ##t## and ##x## discrete. So the continuity equation is,
$$
\rho(n+1,m) - \rho(n,m) = (\rho(n,m+1)-\rho(n,m))u(n,m) + \rho(n,m)(u(n,m+1)-u(n,m))
$$
Everything in this equation is assumed given at ##t=n##. So we can compute ##\rho(n+1,m)##. Sweet. Now what determines ##u(n+1,m)##? That seems to be missing independent of any question regarding boundary conditions.
 
  • #8
hunt_mat said:
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}{t}-L'(t)\frac{\partial\rho}{\partial x'}+\frac{\partial}{\partial x'}(\rho u)=0
[/tex]

I think this should be
[tex]
\frac{\partial \rho}{\partial t} - \frac{x'L'(t)}{L} \frac{\partial \rho}{\partial x'} + \frac{1}{L}\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?

On the boundary you are trying to enforce this condition: [tex]
\frac{\partial \rho}{\partial t} - \frac{x'L'}{L}\frac{\partial \rho}{\partial x'} = 0.[/tex] At x = x' = 0 this is not a problem: it reduces to [itex]\frac{\partial \rho}{\partial t} = 0[/itex]. At [itex]x' = 1[/itex] you can use the integrated conservation equation in the form [tex]
\frac{d}{dt}\int_0^{L(t)} \rho\,dx = 0[/tex] to obtain [tex]
L'(t) \rho(L(t)) + \int_0^L \frac{\partial \rho}{\partial t}\,dx = 0.[/tex] The integral vanishes because it is equal to [itex]\left[- \rho u \right]_0^L = 0[/itex]. That leaves [tex]L'(t)\rho(L(t)) = 0[/tex] so either the bar is of constant length or [itex]\rho(L) = 0[/itex].

Note that you need somehow to determine [itex]L'(t)[/itex].

Paul Colby said:
Let's pull back a bit. Both ##\rho## and ##u## depend on both ##t## and ##x##. What you start with is an equation of conservation. Given ##u(t,x)## for all time one could in principle compute ##\rho(t,x)##, which is where the mass density moves to by solving the differential equation. I don't see any equations that determine ##u##?

Usually in these problems [itex]u = u(\rho)[/itex] is given. Or you can use conservation of momentum.
 
Last edited:
  • Like
Likes hunt_mat
  • #9
pasmith said:
I think this should be
[tex]
\frac{\partial \rho}{\partial t} - \frac{x'L'(t)}{L} \frac{\partial \rho}{\partial x'} + \frac{1}{L}\frac{\partial}{\partial x'} (\rho u) = 0[/tex]
On the boundary you are trying to enforce this condition: [tex]
\frac{\partial \rho}{\partial t} - \frac{x'L'}{L}\frac{\partial \rho}{\partial x'} = 0.[/tex] At x = x' = 0 this is not a problem: it reduces to [itex]\frac{\partial \rho}{\partial t} = 0[/itex]. At [itex]x' = 1[/itex] you can use the integrated conservation equation in the form [tex]
\frac{d}{dt}\int_0^{L(t)} \rho\,dx = 0[/tex] to obtain [tex]
L'(t) \rho(L(t)) + \int_0^L \frac{\partial \rho}{\partial t}\,dx = 0.[/tex] The integral vanishes because it is equal to [itex]\left[- \rho u \right]_0^L = 0[/itex]. That leaves [tex]L'(t)\rho(L(t)) = 0[/tex] so either the bar is of constant length or [itex]\rho(L) = 0[/itex].

Note that you need somehow to determine [itex]L'(t)[/itex].
Usually in these problems [itex]u = u(\rho)[/itex] is given. Or you can use conservation of momentum.
You're correct about the error in transformation, and I agree with your analysis at [itex]n'=0[/itex] but I am a little confused about your analysis, I did a similar analysis for the global conservation of mass. Like you I obtain:
[tex]
\frac{d}{dt}\int_{0}^{L(t)}\rho dx=0\Rightarrow \rho(t,L(t))L'(t)+\int_{0}^{L(t)}\frac{\partial \rho}{\partial t}dx
[/tex]
I then use the equation to obtain:
[tex]
\rho(t,L(t))L'(t)+\int_{0}^{L(t)}\frac{\partial \rho}{\partial t}dx=\rho(t,L(t))L'(t)-\int_{0}^{L(t)}\frac{\partial}{\partial x}(\rho u)dx=\rho(t,L(t))L'(t)-(\rho(t,L(t))u(t,L(t))-\rho(t,0)u(t,0))=\rho(t,L(t))L'(t)-\rho(t,L(t))u(t,L(t))=0
[/tex]
Which yields the condition:
[tex]
L'(t)=u(t,L(t))
[/tex]
This implicitly assumed that [itex]\rho(t,L(t))\neq 0[/itex] though
 
  • #10
Paul Colby said:
Let's pull back a bit. Both ##\rho## and ##u## depend on both ##t## and ##x##. What you start with is an equation of conservation. Given ##u(t,x)## for all time one could in principle compute ##\rho(t,x)##, which is where the mass density moves to by solving the differential equation. I don't see any equations that determine ##u##?
Sorry, I didn't get back to this, there are three equations for [itex]\rho[/itex],[itex]u[/itex] and [itex]T[/itex] but the problem appears in the conservation of mass equation, so I thought that this would be the best equation to demonstrate the problem.
 
  • #11
The equation of continuity that appears in this thread is equally valid for a solid, liquid or gaseous rod. Is it reasonable to expect the boundary conditions to be independent of this?
 
  • #12
Good question. On the free end, I would expect we can apply a stress-free condition as it's allowed to move. I'm not sure how this transfers to the density though.
 
  • #13
Well, I suggest the answer is your boundary conditions depend on the system being modeled. The question as you’ve posed here is incomplete and cannot be answered. The length of the bar changes depending on the velocity at the boundary. This is usually determined by the dynamics, which is missing.
 
  • Like
Likes Frabjous
  • #14
I don't think it does to be honest, the system I'm modelling is essentially the thermal poroelestic system if that helps. I'm treating it as a continuum. As a base level, I require that no mass leaves or enters the system, so the mass flux should be zero at both ends should be zero, and that's modelled by the boundary condition I gave(I think). There is a stress-free condition on the free end, so it's allowed to move.

Do you want to see the rest of the system?
 
  • #15
Not really, it’s your problem. Just in general, if I have a liquid, the manner of constraint of that liquid isn’t determined by it being a liquid or by it being conserved. The constraints, even in the case of being unconstrained, is determined by the problem. Given that your ends are unconstrained, the stress free condition says a solid will sit there oscillating while a gas will expand into a vacuum. If these are the result of your bc, you’re done.
 
  • #16
One of the ends is constrained and the other is free to move. I have a thermal poroelastic medium in which the porosity decreases as you heat up the bar. I don't need to model anything outside the bar.
 
  • #17
hunt_mat said:
I don't need to model anything outside the bar.
I agree because you’ve just specified one end is fixed and one end is moving but unconstrained. The stress vanishes at this end. What does the stress equation say about ##u## and ##\rho## at this point?
 
  • #18

1. What are boundary conditions for a variable length bar?

Boundary conditions for a variable length bar refer to the constraints or limitations placed on the ends of the bar. These conditions can affect the behavior and stability of the bar when subjected to external forces.

2. What are the types of boundary conditions for a variable length bar?

There are three main types of boundary conditions for a variable length bar: fixed, free, and sliding. A fixed boundary condition means the end of the bar is completely fixed and cannot move. A free boundary condition means the end of the bar is completely free to move. A sliding boundary condition means the end of the bar is able to slide along a surface.

3. How do boundary conditions affect the behavior of a variable length bar?

The boundary conditions can greatly influence the behavior of a variable length bar. For example, a fixed boundary condition can provide stability and prevent the bar from buckling under compression, while a free boundary condition can allow for more flexibility and movement of the bar. The type of boundary condition chosen will depend on the specific application and desired outcome.

4. How do you determine the appropriate boundary conditions for a variable length bar?

The appropriate boundary conditions for a variable length bar will depend on various factors such as the material of the bar, the external forces acting on it, and the desired behavior. It is important to carefully analyze these factors and consult with experts to determine the most suitable boundary conditions for a specific application.

5. Can boundary conditions be adjusted for a variable length bar?

Yes, boundary conditions for a variable length bar can be adjusted. However, this may require redesigning or modifying the structure of the bar. It is important to carefully consider and test the effects of any changes to the boundary conditions to ensure the desired behavior and stability of the bar.

Similar threads

Replies
33
Views
2K
Replies
4
Views
1K
  • Classical Physics
Replies
1
Views
137
Replies
6
Views
320
Replies
1
Views
158
Replies
2
Views
1K
Replies
2
Views
1K
  • Special and General Relativity
Replies
7
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
573
Back
Top