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.

Function varying in time and space

Please login with a confirmed email address before reporting spam

Hi everyone! I would need your help :) I am implementing a model using laminar flow physic in which I need to apply a boundary velocity perpendicular to the boundary itself that varies in both time and space. So, I would like this velocity on the boundary to activate after a certain time interval and move as an impulse along the boundary itself( something like a soliton)

I tried to multiply some functions but I couldn't solve it. Using a rect(t) I think I can solve the problem of 'activate' the velocity after a certain time but how can I set the movement along the boundary itself?

Does anyone have any suggestions? Thank you very much for your kind help Florinda



6 Replies Last Post Nov 17, 2020, 3:43 p.m. EST
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 11, 2020, 5:13 p.m. EST
Updated: 3 years ago Nov 11, 2020, 5:24 p.m. EST

Florinda,

in case the movement is intended along the x-axis with velocity v the boundary function would look like f = f(x(t)) = f(v*t). f may be the Gauss function as indicated in your animation.

With f = rect(t0)f(vt) you switch it at t = t0. You may need to smooth the rectangle function in order to get a time dependent solver to converge.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Florinda, in case the movement is intended along the x-axis with velocity v the boundary function would look like f = f(x(t)) = f(v*t). f may be the Gauss function as indicated in your animation. With f = rect(t0)*f(v*t) you switch it at t = t0. You may need to smooth the rectangle function in order to get a time dependent solver to converge. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 16, 2020, 9:22 a.m. EST

Dear Edgar, thank you for your kind reply.

I tried to implement the function as you suggested but I didn't solve the problem of the impulse moving in space (along the x-direction).

As you can see in the attached gif, the function is activated after the time indicated by t0 but does not propagate along the x axis but starts from the whole boundary at the same time. I tried to indicate the units of measurement by setting velocity(m/s)t(s) within the function gp1(Gaussian impulse) in such a way as to underline the dependence on space rather than time but I was not able to solve the problem.

Thank you for your help

Florinda

Dear Edgar, thank you for your kind reply. I tried to implement the function as you suggested but I didn't solve the problem of the impulse moving in space (along the x-direction). As you can see in the attached gif, the function is activated after the time indicated by t0 but does not propagate along the x axis but starts from the whole boundary at the same time. I tried to indicate the units of measurement by setting velocity(m/s)t(s) within the function gp1(Gaussian impulse) in such a way as to underline the dependence on space rather than time but I was not able to solve the problem. Thank you for your help Florinda


Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 16, 2020, 10:47 a.m. EST

Dear Florinda,

Will using the following solve your issue: on the inlet, use the following expression: gp1(x-tB) Here the gp1(x) is your gaussian function, which should be setup in such a way that the location at t=0 is correct. The tB makes sure that the center is moving with time (t). B is the scaling for how fast it should move. Eg. at t = 1 s, the location is now at B.

best regards, Frank

Dear Florinda, Will using the following solve your issue: on the inlet, use the following expression: gp1(x-t*B) Here the gp1(x) is your gaussian function, which should be setup in such a way that the location at t=0 is correct. The t*B makes sure that the center is moving with time (t). B is the scaling for how fast it should move. Eg. at t = 1 s, the location is now at B. best regards, Frank


Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 16, 2020, 1:24 p.m. EST
Updated: 3 years ago Nov 16, 2020, 1:25 p.m. EST

Dear Frank, thank you so much.

Do you think that I can set this condition to a leaking wall instead of an inlet? I need to implement a couette profile of the velocity field, so according to your geometry that is similar to mine I need to set these conditions: 1. boundary on the top: no slip; 2. boundary on the left inlet pressure=0; 3. boundary on the right outlet pressure=0; 4. boundary on the bottom: leaking wall, fluid velocity, on x this function

according to your suggestion I defined my gp1 (centered in 0) and I wrote as function 1e-3 gp1(x-t1e-3) my rectangle left corner on the bottom is in (0,0)

my boundaries are 3 mm and the velocity is 1 mm/s, but I cannot obtain your same result.

Thank you for your help Florinda

Dear Frank, thank you so much. Do you think that I can set this condition to a leaking wall instead of an inlet? I need to implement a couette profile of the velocity field, so according to your geometry that is similar to mine I need to set these conditions: 1. boundary on the top: no slip; 2. boundary on the left inlet pressure=0; 3. boundary on the right outlet pressure=0; 4. boundary on the bottom: leaking wall, fluid velocity, on x this function according to your suggestion I defined my gp1 (centered in 0) and I wrote as function 1e-3 *gp1(x-t*1e-3) my rectangle left corner on the bottom is in (0,0) my boundaries are 3 mm and the velocity is 1 mm/s, but I cannot obtain your same result. Thank you for your help Florinda


Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 17, 2020, 3:14 a.m. EST

Dear Florinda,

attached my file so you can see what I did. I hope that helps. Good luck with the model.

Best regards, Frank

Dear Florinda, attached my file so you can see what I did. I hope that helps. Good luck with the model. Best regards, Frank


Please login with a confirmed email address before reporting spam

Posted: 3 years ago Nov 17, 2020, 3:43 p.m. EST

Dear Frank, thank you so much for your kind help! thank you Florinda

Dear Frank, thank you so much for your kind help! thank you Florinda

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.