Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Sloshing Tank - No convergence when making the tank longer

Please login with a confirmed email address before reporting spam

Hi all,

I've just started using COMSOL for school and I must say it's a world of fun, but I have lots learning to do! I'm working primarily off of COMSOL's sloshing tank example, though I've changed the units/dimensions of the "tank" (it's a cross-section of a culture plate now) and the properties of the fluid (using water now). I've given the fluid the dimensions of 2mm by 78mm (maintain symmetry about the y-axis), as that's approximately the height and length respectively of the fluid's cross-section at rest.

There are two issues. If I work with a fine mesh and make the time steps small enough (i.e. range(0,0.01,1)), the program doesn't even get off the ground (I get a "failure to find consistent initial values" error). When I make the mesh coarser and adjust the time step, the nonlinear solver does not converge, and always stops at around 0.4 seconds.

I tried attaching the mph file but I get a "file size error" message. If you just change the dimensions of the tank and the properties of the fluid it's the same problem. I'd appreciate any suggestions. Thanks!

- Ben M.

8 Replies Last Post 11 giu 2012, 09:01 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 7 giu 2012, 02:14 GMT-4
Hi

to upload files clear the solution and the mesh and reset the history, the files becomes much smaller and easier to upload.

That said, the sloshing tank is already a complex physics, and CFD is very sensitive to size and size ratios of mesh and objects. Try to plot the value "h" average mesh size in the original library model, and note the total size of the tank, then do the same on yours and adapt the mesh to be at least as dense in ration.

but it could well also be something else that has changed, not easy to tell

--
Good luck
Ivar
Hi to upload files clear the solution and the mesh and reset the history, the files becomes much smaller and easier to upload. That said, the sloshing tank is already a complex physics, and CFD is very sensitive to size and size ratios of mesh and objects. Try to plot the value "h" average mesh size in the original library model, and note the total size of the tank, then do the same on yours and adapt the mesh to be at least as dense in ration. but it could well also be something else that has changed, not easy to tell -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 7 giu 2012, 13:15 GMT-4
I've attached my file below (thanks for tips on how to cut down the file size).

My current study is solving the system between 1/4 of the period (1/4*T) and 3/4 of the period (3/4*T), but the times don't really matter so much. I just want to capture the time when the shear stress on the bottom of the tank is greatest (i.e. 1/4*T and 3/4*T)

Also I'm not sure how to plot the average mesh size. I could plot h at all points on the mesh but wasn't able to average all the values into one statistic. I looked into aveop1 which seems like it would do the trick, but haven't had much luck with it. Thanks!

- Ben M.
I've attached my file below (thanks for tips on how to cut down the file size). My current study is solving the system between 1/4 of the period (1/4*T) and 3/4 of the period (3/4*T), but the times don't really matter so much. I just want to capture the time when the shear stress on the bottom of the tank is greatest (i.e. 1/4*T and 3/4*T) Also I'm not sure how to plot the average mesh size. I could plot h at all points on the mesh but wasn't able to average all the values into one statistic. I looked into aveop1 which seems like it would do the trick, but haven't had much luck with it. Thanks! - Ben M.


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 giu 2012, 05:01 GMT-4
Hi

to plot themesh size just plot "h" on the surface. aveop1(h) will give you a an average value, the mesh statistics a nice histogram view ... toget a reasonable fluid flow modelisation you need a rather "small" mesh and as you have a shorter time steps you need to be sure the mesh density allows to catch short term short scale effects for the sover to be efficient.

For me it works OK, it slow to solve indeed as the solver takes small steps and does not maange to use larger steps from its default set-up criteria

Now what I was woundering the most about, is that you say time does not matter, when you start to move, you need 2-3 oscillations tu build up a more or less steady state situation so that your measurements are representative, or ?

And with a "slip" condition you do not get much shear stress in the fluid, I would propose then to make a thin layer at the bottom of the fluid and integrate over this to get a better feeling (and with a small mesh locally to get a reasonable resolution) for y fluid you have only the diagonal terms of the stress, check the variables, but I would rather look at the velocity profile and directions in this boundary region and see how to best estimate the stress.

Then perhaps use a non-slip condition on the boundary and see how different it makes things, where is the reality of what you are looking for ? I cannot tell ;)

--
Good luck
Ivar
Hi to plot themesh size just plot "h" on the surface. aveop1(h) will give you a an average value, the mesh statistics a nice histogram view ... toget a reasonable fluid flow modelisation you need a rather "small" mesh and as you have a shorter time steps you need to be sure the mesh density allows to catch short term short scale effects for the sover to be efficient. For me it works OK, it slow to solve indeed as the solver takes small steps and does not maange to use larger steps from its default set-up criteria Now what I was woundering the most about, is that you say time does not matter, when you start to move, you need 2-3 oscillations tu build up a more or less steady state situation so that your measurements are representative, or ? And with a "slip" condition you do not get much shear stress in the fluid, I would propose then to make a thin layer at the bottom of the fluid and integrate over this to get a better feeling (and with a small mesh locally to get a reasonable resolution) for y fluid you have only the diagonal terms of the stress, check the variables, but I would rather look at the velocity profile and directions in this boundary region and see how to best estimate the stress. Then perhaps use a non-slip condition on the boundary and see how different it makes things, where is the reality of what you are looking for ? I cannot tell ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 giu 2012, 08:07 GMT-4
Dear Ivar,

Thanks for your helpful reply! So you were able to get it to work using a finer mesh? I'll try it, but it wasn't working for me before.

You're right, I would need a few oscillations to get to the steady state. But for the setup we're using, the apparatus gets to the maximum height, pauses, then descends to the minimum height, pauses, and so on. So It's not a purely sinusoidal oscillation. I really just need to capture the movement from the crest to the trough of the oscillation, starting at rest.

Hmm. I'm not exactly sure what to do with the thin layer you have suggested. Would this be beneath the fluid? You're definitely right though, I got the model to work once for a small time window and the shear stresses were unusually low. I'm guessing this new layer would give a more accurate representation of the stress. But if I used no-slip boundary conditions on the floor, as you suggested, would this eliminate the need for a new layer?

We're going to add a structure eventually that bends as the flow is passed back and forth, so we want to get an idea of what magnitudes of stresses the structure will be subjected to before doing so. So a velocity profile relating the angle of inclination to the shear stress would be useful.

Much thanks!

- Ben M.
Dear Ivar, Thanks for your helpful reply! So you were able to get it to work using a finer mesh? I'll try it, but it wasn't working for me before. You're right, I would need a few oscillations to get to the steady state. But for the setup we're using, the apparatus gets to the maximum height, pauses, then descends to the minimum height, pauses, and so on. So It's not a purely sinusoidal oscillation. I really just need to capture the movement from the crest to the trough of the oscillation, starting at rest. Hmm. I'm not exactly sure what to do with the thin layer you have suggested. Would this be beneath the fluid? You're definitely right though, I got the model to work once for a small time window and the shear stresses were unusually low. I'm guessing this new layer would give a more accurate representation of the stress. But if I used no-slip boundary conditions on the floor, as you suggested, would this eliminate the need for a new layer? We're going to add a structure eventually that bends as the flow is passed back and forth, so we want to get an idea of what magnitudes of stresses the structure will be subjected to before doing so. So a velocity profile relating the angle of inclination to the shear stress would be useful. Much thanks! - Ben M.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 giu 2012, 15:25 GMT-4
Hi

for me the layer was to be made in the fluid, just above the wall. I'm not sure the fluid x stress would really give you the resuting forces for a structure thereon, as the structure will also interfer with the fluid.

Then I would propose to use FSI and set up your structure interacting with the fluid and see the resulting stress in the structure, and adapt its shape accordingly

--
Good luck
Ivar
Hi for me the layer was to be made in the fluid, just above the wall. I'm not sure the fluid x stress would really give you the resuting forces for a structure thereon, as the structure will also interfer with the fluid. Then I would propose to use FSI and set up your structure interacting with the fluid and see the resulting stress in the structure, and adapt its shape accordingly -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 giu 2012, 21:21 GMT-4
Thanks for the input. I'm trying to setup an FSI problem with the same settings as before, but I'm getting errors about inverted meshes and not being able to find consistent initial values. I inserted a thin solid into the fluid close to but not on the lower boundary. I've been trying to constrain the solid in displacement and prevent it from deforming (so it just essentially "detects" shear stress and is not affected in the process). I've also been using a no-slip condition on the lower boundary, as you recommended.

Also my original problem was too computationally intense to do (no cluster computing options available here, and even on a 64-bit system there were issues), but I tried the same problem using smaller lengths (5mm, 10mm, 20mm, etc.) and found that the max shear stress scales with length. I'll just take advantage of that for the future.

Thanks in advance.

- Ben M.
Thanks for the input. I'm trying to setup an FSI problem with the same settings as before, but I'm getting errors about inverted meshes and not being able to find consistent initial values. I inserted a thin solid into the fluid close to but not on the lower boundary. I've been trying to constrain the solid in displacement and prevent it from deforming (so it just essentially "detects" shear stress and is not affected in the process). I've also been using a no-slip condition on the lower boundary, as you recommended. Also my original problem was too computationally intense to do (no cluster computing options available here, and even on a 64-bit system there were issues), but I tried the same problem using smaller lengths (5mm, 10mm, 20mm, etc.) and found that the max shear stress scales with length. I'll just take advantage of that for the future. Thanks in advance. - Ben M.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 giu 2012, 06:01 GMT-4
Hi,

Usually when a sloshing simulation like this one fails is because you have separation of your fluid domain, i.e. some drops 'escape' the overall fluid domain.

You can get convergence if you reduce the max angle down to 2 degrees.

You will need to re-compute the solution, I cleared it because the file was too large.

Cheers
Hi, Usually when a sloshing simulation like this one fails is because you have separation of your fluid domain, i.e. some drops 'escape' the overall fluid domain. You can get convergence if you reduce the max angle down to 2 degrees. You will need to re-compute the solution, I cleared it because the file was too large. Cheers


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 giu 2012, 09:01 GMT-4
Dear Amir,

Ah, I understand. In the actual setup I'm modeling, the fluid is in a well that's 12mm high, so it should just climb the walls. I guess I foolishly assumed that COMSOL would not impose any height limitations on the boundaries. The angle of inclination of the setup is around ten degrees, but I understand why it would work with a smaller angle. Is there any way to specify the height of the walls, or build a structure around the fluid that represents the well? Thanks for your input!

- Ben M.
Dear Amir, Ah, I understand. In the actual setup I'm modeling, the fluid is in a well that's 12mm high, so it should just climb the walls. I guess I foolishly assumed that COMSOL would not impose any height limitations on the boundaries. The angle of inclination of the setup is around ten degrees, but I understand why it would work with a smaller angle. Is there any way to specify the height of the walls, or build a structure around the fluid that represents the well? Thanks for your input! - Ben M.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.