Reset grid in time dependent problems

General discussions about how to formulate a script for FlexPDE.

Reset grid in time dependent problems

Postby jlsanhueza on Wed Jan 02, 2019 12:29 pm

Hello users and moderators,

I'm working in fluid mechanics with moving meshes to solve the Navier-Stokes equations and my main goal is to "reset" the grid every time step or after the script is done, so I can run another script loading the final boundary geometry but with a new mesh configuration.

In the attached script, there are 2 fluids with different viscosities and densities (that's why I added a buoyancy gravity term to a particular region). At the end of the run I want to preserve the boundaries (mainly the region 2 - yellow one) but reset the mesh configuration. The reason is because I want to study how the region 2 travels along the region 1. However, when time becomes large enough (increasing the T value in the code) some nodes collapse, that's why reseting the mesh would be useful to adress this problem.

I've tried TRANSFERMESH, RESOLVE and FRONT commands with no success at all, altough I could transfer the whole boundaries+mesh configuration at the final stage, but I couldnt re-mesh from that. Also, I haven't tried STAGES yet since I'm getting a "MEMORY PROTECTION FAULT" if I remove the time dependence.

Any suggestions?

Thanks in advance to everyone.

Notes:
1. I'm using 6.5 professional version.
2. Some units in the script are meaningless.
3. I want to use this code to solve geological problems (deformation controlled by creep), so my viscosities are up to ~10^20 [Pa s] and time ~10^13 seconds (millions of years).
Attachments
two_fluids_test.pde
(984 Bytes) Downloaded 27 times
jlsanhueza
 
Posts: 3
Joined: Thu Dec 27, 2018 1:30 pm

Re: Reset grid in time dependent problems

Postby moderator on Mon Jan 07, 2019 4:15 pm

The mesh motion equation div(grad(xm))=0 is a generic kind of motion equation that works in some problems, but in others (like yours) it allows the mesh to smash at the front of a moving object.
There are other equations that can be used to move the mesh that prevent that kind of compression.
Unfortunately, I have meetings this afternoon, and will have to address this in more detail tomorrow.
moderator
 
Posts: 770
Joined: Tue Jan 11, 2011 1:45 pm

Re: Reset grid in time dependent problems

Postby moderator on Wed Jan 09, 2019 2:03 pm

One approach in fluid problems is to use a Lagrangean formulation, and lock the mesh motion to the fluid motion.
Since you are already calculating fluid velocities, you can drag the mesh along with the fluid simply by providing the mesh motion equations
Xm: dt(Xm) = vx
Ym: dt(Ym) = vy

Unfortunately, you have conflicting boundary conditions which prevent this from working correctly.
You have provided both a uniform pressure and a uniform velocity on the left boundary, along with a fixed upper and lower boundary velocity.
A uniform pressure does not create a uniform velocity when there is drag on the walls. The velocity will tend toward a parabolic shape in the channel.
Also, forcing both a zero velocity and a non-zero velocity at the meeting of two boundaries induces an unresolvable shear at the corner point.
moderator
 
Posts: 770
Joined: Tue Jan 11, 2011 1:45 pm

Re: Reset grid in time dependent problems

Postby jlsanhueza on Mon Feb 04, 2019 1:42 pm

Thank you for your response, since I was doing field work during January I couldn't asnwer/work during that time. To correct my code, I over simplified the problem to avoid conflicting boundary conditions just to learn how to use this feature.

In this new code I didn't lock the mesh and It worked better than before. However I'm not sure if this is the best way to do so.

If I lock the mesh by using "VELOCITY(Xm)=0" in region 1 It doesnt work properly.
Attachments
two_fluids_simplified.pde
(555 Bytes) Downloaded 18 times
jlsanhueza
 
Posts: 3
Joined: Thu Dec 27, 2018 1:30 pm

Re: Reset grid in time dependent problems

Postby moderator on Wed Feb 06, 2019 9:25 pm

Here is a modification of your script that seems to work.
I did several things:
1) velocity(xm)=vx is a tautology. that's what it will be anyway, because of the xm equation. It caused trouble, so I removed it.
2) I don't believe natural(vx)=0 on the sides is correct. This causes the vx contours to meet the wall at right angles. That's ok in the beginning, but when the figure has acquired a lot of shear, it causes trouble, warping tine velocity to enter and exit with a strong vertical velocity. I replaced it with a continuation of the top and bottom velocities, which preserves the x-directedness of the flow. The warped velocities eventually caused the lower left and upper right sidewalls to go flat, which made an inconsistency: a sudden transition from natural()=0 to value()=#. Also, when the corners go flat, it smashes the corner cells to zero volume and crashes. (A diagonal feature would avoid this problem.)
3) I chose a small starting dt, to ease startup troubles.
4) I made the Vx threshold 1 instead of 10. The THRESHOLD is the smallest value of the variable range for which ERRLIM is obeyed. I thought a smaller value might help starting up.
Attachments
two_fluids_simplified_2.pde
(603 Bytes) Downloaded 21 times
moderator
 
Posts: 770
Joined: Tue Jan 11, 2011 1:45 pm

Re: Reset grid in time dependent problems

Postby moderator on Thu Feb 07, 2019 10:49 pm

Periodic BC on the sides might be better.
moderator
 
Posts: 770
Joined: Tue Jan 11, 2011 1:45 pm

Re: Reset grid in time dependent problems

Postby jlsanhueza on Sun Feb 10, 2019 9:37 am

Thank you a lot for your help!, this solution makes sense. Now I can continue with my main problem.
jlsanhueza
 
Posts: 3
Joined: Thu Dec 27, 2018 1:30 pm


Return to FlexPDE Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron