parabolic profile initial condition

Submitted by AliBlues on Fri, 03/17/2017 - 13:55

Hi,
Imagine a 3D particulate channel flow with periodic boundaries along the depth. So the "2D" parabolic velocity profile can be imposed at inlet of channel. The particles are continously inserted at a small region near the inlet.
How can I impose the parabolic profile on the particles? Because with the fix insert commands i can only impose a uniform velocity to all particles. Can I do this by just some additions to the input script, or do I really need to modify the fix insert (say insert/rate/region) code? I would really appreciate any suggestions.

Thank you,
Ali

ckloss's picture

ckloss | Sun, 04/23/2017 - 12:00

Hi Ali,

what I would do is the following: use a fix insert/rate/region and then imposing your velocity profile at the end of the region with a simple fix that you write

Best wishes
Christoph

AliBlues | Sat, 09/02/2017 - 14:01

Thank you Christoph for the reply. But could you further elaborate on this. I still not sure how to do this cause I don't have much experience in code development in LIGGGHTS. But from your description it sounds like a quick implementation.
Correct me if I'm wrong, so what you are proposing would look something like the "vel gaussian" keyword, correct. So say "vel Parabolic" which would take into account the mean velocity and height of channel as input and would calculate it in the fix?
I thought there would be a fix for "vel gaussian". But I don't see any such fix name. Also doing a grep search in the LIGGGHTS folder doesn't give any indication of where this is actually coded.
Assuming that the fix is implemented (using your help :)), then do I need to add the header file of the fix to the top of the code in the rate/insert/region.ccp code.

So again I would greatly appreciate it if you would provide further assistance on this. I think it also sounds like a nice tutorial. Later on I'm planning to actually insert the particles in non-periodic rectangular channels, so the profile is 3D. Though the analytical solution is based on series expansion, it should be possible to fit it to a polynomial.

Thank you in advance for you time and assistance.
Best
Ali
P.S. sorry for getting back this late. Needed to take care of some other topics first.

AliBlues | Mon, 09/18/2017 - 15:16

Hi,
Again I would really appreciate it if someone would let me know on how to proceed with implementing the fix for the parabolic velocity profile, as explained above.
Best,
Ali

mschramm | Mon, 09/18/2017 - 21:32

You could copy what is done in fix_insert_stream.cpp to create your own fix_insert_stream_parabolic.cpp and .h files
Where fix.insert_stream would assign a random velocity, you would assign a velocity dependent on the particles position.
You would then need to make changes to the root fix_insert file to allow the changes that you are making

AliBlues | Tue, 09/19/2017 - 11:53

Thanks a lot for the reply. Very much appreciate it.
Indeed, so if I look at the root fix_insert, I'll see the implementation of the vel=constant or Gaussian used in the fix_insert_stream. Was wondering where these options are implemented. Great so then I can just use this as starting point.
Just one thing, I didn't get what you mean by the "random" assignment of the velocity in fix.insert_stream. I'm guessing this is when I don't specify one of the "vel" options (e.g constant or Gaussian ), right?

Best
Ali

AliBlues | Wed, 09/20/2017 - 10:04

Actually just forget about my last comment. Have been thinking so much about parabolic that I thought Gaussian option is a spatially gaussian velocity profile!!!
Best
Ali

mschramm | Thu, 09/21/2017 - 16:24

I was referencing fix_insert_stream calling the fix_insert command "generate_random_velocity".
This is normally where fix_insert_stream would assign a uniform random distribution for a Gaussian
random distribution of velocities. You would want to create your own function that would assign
a velocity based on the position of a particle.

AliBlues | Mon, 09/25/2017 - 18:47

Hi,
I had a look at the fix_insert_stream and as you suggested it seems that one can replace the random generation with a parabolic profile. I have some questions about this:

On line 808 of the fix_insert_stream.cpp,
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_inse...

the "generate_random_velocity" function takes "v_toInsert" (declared in line 802) as argument and return its value following its computation in fix_insert.cpp line 956:
https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/fix_inse...
where the v_insert and v_insertFluct are member data of the fix_insert class.

1) So then it seems I can pass on the particle’s position using x[i], so something like:

//start code
Double particlePosition[3]
vectorCopy3D(x[i],particlePosition)
generate_parabolic_velocity(v_toInsert,particlePosition)
//end code

So is this correct?

I also have to define two additional member data Umean (mean velocity) and Height of channel in the fix_insert code.

2) Also is x[i] the “final” particle insertion position.

3) The other question concerns the different insertion method, the fix_insert_rate_region; so while it also allows for Gaussian velocity but no where in the code there is a call to the "generate_random_velocity". Which makes me wonder again of the approach Christoph suggested to implement the parabolic velocity with this insertion: “use a fix insert/rate/region and then imposing your velocity profile at the end of the region with a simple fix that you write”. I actually wouldn’t know where to start from in this case.

Thank you
Ali

mschramm | Wed, 09/27/2017 - 15:37

1) That seems correct to me. I haven't used LIGGGHTS' member functions (vectorCopy3D) very much so double check the ordering there but that should be correct.

2) I do not know. In the code on lines 788 and 789 it says that the x variable is the "original position to integrate". If this is not the final position, you would still be assigning the particle's velocity with respect to its position at that point and would then be integrated to the next time step with the velocity you selected. The code probably does insertion and then integrates all particles.

3) I think Christoph was referring to using the "add force" command, and input a drag force on all particles. I did something similar to this adding a channel flow and a "pseudo" magnetic field (local attracter)

# Add additional forces
variable FM atom sqrt((${tube_length}/2-x)^2+(-${tube_radius}-y)^2+z^2+0.025)^3.0
variable FX1 atom ${mag_str}*(${tube_length}/2-x)/v_FM
variable FX2 atom -1.0*(vx-(${mean_flow}*(1-abs(y)/${tube_diameter}/2.0)^2.0))
variable FX atom v_FX1+v_FX2
variable FY atom (${mag_str}*(-${tube_radius}-y)/v_FM-1*vy)
variable FZ atom (-${mag_str}*z/v_FM-1*vz)
fix kick all addforce v_FX v_FY v_FZ