Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

periodic inlet expression in laminar flow

Please login with a confirmed email address before reporting spam

Dear Dr. Ivar,

First thank you for your comment, I am so appreciated.

Without the period inlet condition, I can run this model, which adds a little confidence to me!

According to your comment
"set the initial pressure also to "1000" or even to "1000[Pa]+Po*(0.180-x[1/m])/0.180" (where 0.180 is you total fluid length) the latter gives a small pressure drop along the tube to be decided what to use for Po[Pa], I usually look up the Poiseuille law, as initial conditions. By the way do not forget the initial pressure conditions for the gravity effects "g_const*rho*1[m]*(0.180-x[1/m])" taking into account your gravity direction and the fact that you are in 2D, hence everything is expressed "per meter" depth (Z out of paper direction)"

I think you are right, the initial pressure should be larger than 1000pa, but I also thought before time begins,when t(s)=0, the tube is empty, than initial pressure and velocity should be 0, is it right?

Also the gravity effects, can I just add to the pressure term, which initial pressure is
1000[Pa]+Po*(0.180-x[1/m])/0.180-g_const*rho*1[m]*(0.180-x[1/m]),
which I think make sense because in human leg they are in the x-direction, but in this geometry gravity is in y direction, I am confused is it right to set or not?

than to the inlet, when I set as u_max*(1-s)^2, it runs ok, but when I set the velocity to be periodic through the function of A=(abs(sin(2*pi*t/3))+sin(2*pi*t/3))/2
u=u_max*A*(1-s)^2
I attached the plot of function A, which is the period function , but why when I type in Comsol, it shows expression error. Can you help me with this?

According to your comments
" To be able to easily check the model you might want to run just the stationary solver, if you disable the time series, AND add a parameter "t = 0[s]" then you can run it alone, even using "t=0.1[s]" would help to see if the flow "goes on", when you then turn on the time series again, "

What is the time series, sorry, I cannot find it and disable it? Is it the "Step 2:Time dependent"? I am reading the user's guide about solver, maybe I can find something there!

I know I am too bad about comsol, but I really tried very hard, I spent my whole after-class time to do it and read the user's guide, really thank you so much!

Best wishes to you!


4 Replies Last Post 2011年4月18日 GMT-4 10:24
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 2011年4月16日 GMT-4 05:17
Hi

You have many questions, Ill try to answer, but in steps.

First a few general comments, I notice when I open the model:
- you are not always respecting units, it helps to do it as then you can easier check that everything is OK, among other your amplitude A is flagged "orange" units issue, this comes from the fact that functions expect unit-less input and your "t" is expressed with units Seconds. Write rather

( abs( sin(2*pi*t[1/s]/3) )+sin(2*pi*t[1/s]/3) )/2

then it goes black ,and all related equations too.

For your gravity initial value compensation, I recommend always to work in [m] even if your geometry is in [mm]
So instead of :
1000[Pa]+1000[Pa]*(180-x[1/mm])/180-g_const*rho*1[m]*(0.180-x[1/m]) try rather

1000[Pa]+1000[Pa]*(0.180-x[1/m])/0.180-g_const*rho*1[m]*(0.180-x[1/m])

Normally it should work, but sometimes I have doubt (I may even have suggested it that way ;)

Back to your questions/remarks.

First, I would rather say at t=0 the tube is filled with a liquid (not empty) but at rest = 0 velocity (probably with some pressure though).

then the direction of gravity: x.y.z are an arbitrary reference, from the moment you decide that gravity is along -X, then for us humans, on our Earth, it means also that X points upwards to the sky, as for a person standing. If your case is for a person siting or laying and X is the horizontal direction of the leg of that person then you should set "-rho*g_const" along Y, or perpendicular to the flow. Then the effect of gravity will be small and you can just forget it for the initial conditions, COMSOL will take care from the moment you define it in the volume force.

You should also check your initial conditions, to see if they are coherent. For that (since you have a stationary and a transient case) you need to define a parameter t = 0.1[s] (the 0.1 is just to get your velocity amplitude to something else than "0") then you can select the "dependent variable" and click right Compute to selected. Thereafter you might plot "p" to check that is looks OK

In any case be patient, COMSOL is complex, yes, because it covers ALL physics (afield that took me about 4 years at university to study, and not even to see aspects covered by COMSOL), but by going step by step you will manage as us others. Its just that you are starting with a nice but rather complex model. I believe I have read the doc about 3-4 times, and each time I find new things I looked over the previous times, so learning is indeed an incremental process)

So to check your expression of "A," I used a "Definition Function Analytical" and set your equation therein, then I gave a range for t from 0 to 6 and plotted it, it looks nice

By the way you should update to the latest Patch, there are a few things that have been improved after your .88 release, particularly in fluidics. As for me it works very well, by replacing umax by uamp, I see the pulse

Next step is to add the structure, and link the fluid pressure to the structure surface load, to attach it, good luck

--
Have fun Comsoling
Ivar
Hi You have many questions, Ill try to answer, but in steps. First a few general comments, I notice when I open the model: - you are not always respecting units, it helps to do it as then you can easier check that everything is OK, among other your amplitude A is flagged "orange" units issue, this comes from the fact that functions expect unit-less input and your "t" is expressed with units Seconds. Write rather ( abs( sin(2*pi*t[1/s]/3) )+sin(2*pi*t[1/s]/3) )/2 then it goes black ,and all related equations too. For your gravity initial value compensation, I recommend always to work in [m] even if your geometry is in [mm] So instead of : 1000[Pa]+1000[Pa]*(180-x[1/mm])/180-g_const*rho*1[m]*(0.180-x[1/m]) try rather 1000[Pa]+1000[Pa]*(0.180-x[1/m])/0.180-g_const*rho*1[m]*(0.180-x[1/m]) Normally it should work, but sometimes I have doubt (I may even have suggested it that way ;) Back to your questions/remarks. First, I would rather say at t=0 the tube is filled with a liquid (not empty) but at rest = 0 velocity (probably with some pressure though). then the direction of gravity: x.y.z are an arbitrary reference, from the moment you decide that gravity is along -X, then for us humans, on our Earth, it means also that X points upwards to the sky, as for a person standing. If your case is for a person siting or laying and X is the horizontal direction of the leg of that person then you should set "-rho*g_const" along Y, or perpendicular to the flow. Then the effect of gravity will be small and you can just forget it for the initial conditions, COMSOL will take care from the moment you define it in the volume force. You should also check your initial conditions, to see if they are coherent. For that (since you have a stationary and a transient case) you need to define a parameter t = 0.1[s] (the 0.1 is just to get your velocity amplitude to something else than "0") then you can select the "dependent variable" and click right Compute to selected. Thereafter you might plot "p" to check that is looks OK In any case be patient, COMSOL is complex, yes, because it covers ALL physics (afield that took me about 4 years at university to study, and not even to see aspects covered by COMSOL), but by going step by step you will manage as us others. Its just that you are starting with a nice but rather complex model. I believe I have read the doc about 3-4 times, and each time I find new things I looked over the previous times, so learning is indeed an incremental process) So to check your expression of "A," I used a "Definition Function Analytical" and set your equation therein, then I gave a range for t from 0 to 6 and plotted it, it looks nice By the way you should update to the latest Patch, there are a few things that have been improved after your .88 release, particularly in fluidics. As for me it works very well, by replacing umax by uamp, I see the pulse Next step is to add the structure, and link the fluid pressure to the structure surface load, to attach it, good luck -- Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年4月16日 GMT-4 22:44
Dear Dr.Ivar

I don't know what should I say to express my thanks to you. You are so nice and patient to me! Not only explain the problem so detail to a beginner, also give me encouragement! Thanks !

I ran the model, and use the play video, I can see how the fluid flows! This software is really good!

I have a little confusion left: If I didn't set the variable t=0.1s, I cannot run the time-dependent solver, but once I set a time-dependent variable t=0.1s, it runs well. Is it because I have step 1 which is stationary, so I have to set up a t value to get the initial value than go to step 2? So if I only have step 1 which is time dependent, I don't need to set the t=0.1? (I know you said first do the stationary is wise)

Thank you so much! I will add the plane model to see how far I can go:)

Give my best wishes!
Dear Dr.Ivar I don't know what should I say to express my thanks to you. You are so nice and patient to me! Not only explain the problem so detail to a beginner, also give me encouragement! Thanks ! I ran the model, and use the play video, I can see how the fluid flows! This software is really good! I have a little confusion left: If I didn't set the variable t=0.1s, I cannot run the time-dependent solver, but once I set a time-dependent variable t=0.1s, it runs well. Is it because I have step 1 which is stationary, so I have to set up a t value to get the initial value than go to step 2? So if I only have step 1 which is time dependent, I don't need to set the t=0.1? (I know you said first do the stationary is wise) Thank you so much! I will add the plane model to see how far I can go:) Give my best wishes!

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 2011年4月17日 GMT-4 03:42
Hi

if I read you well you defined a Variable t=0.1[s], I wrote (hope so) a "Parameter", these are different.

A Parameter (=Constant) is evaluated once at the launch of a solver process and can therafter be overwritten by other definitions.

But a Varaible is evaluatedand updated regularly during the solver process. As COMSOL has already defined the variable "t", you can only force an "initial condition" via a Parameter, but not via a Variable, othervise you have a varaible naming conflict.

I have noticed that Comsol defines striclty "t" only at the moment a transient solver is involved, normally t=0 by default if no transient solver is called but at least in my 4.1.0.185 (you should patch your version) t is flagged as UNDEFINED if I refer to it without any Parameter definition and without a transient sovler active

--
Good luck
Ivar
Hi if I read you well you defined a Variable t=0.1[s], I wrote (hope so) a "Parameter", these are different. A Parameter (=Constant) is evaluated once at the launch of a solver process and can therafter be overwritten by other definitions. But a Varaible is evaluatedand updated regularly during the solver process. As COMSOL has already defined the variable "t", you can only force an "initial condition" via a Parameter, but not via a Variable, othervise you have a varaible naming conflict. I have noticed that Comsol defines striclty "t" only at the moment a transient solver is involved, normally t=0 by default if no transient solver is called but at least in my 4.1.0.185 (you should patch your version) t is flagged as UNDEFINED if I refer to it without any Parameter definition and without a transient sovler active -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年4月18日 GMT-4 10:24
Dear Dr. Ivar,

1) I am sorry I typed wrong, now I understand the difference between parameter and variable. You are right from the beginning.

2) Now I tried to add the plane strain model, is shows the error:
"Undefined value found.
- Detail: NaN_or_Inf_found_when_solving_linear_system_using_PARDISO'
What is this error mean?
Is it because my equations or boundary Conditions are not sufficient to make an unique solution, I should add the moving mesh? (But I want to let it works first then add another)

3) I tried to learn from the structure model tutorial in this website, unfortunately I don't have the MIES model, I read the pdf file and the user guide, still have lots of confusion with weak constrains. Do you have some suggestions to learn about weak constraint?

4) 'lm' should be applied to boundaries with Dirchlet condition between two physics, for my model, the inner membrane is set with body load u_lm and v_lm, for my understanding, the fluid and plane strain is related by
a.) the pressure of the fluid on the membrane
b.) the inner membrane velocity should be same as the fluid velocity at the inner membrane wall
I am not sure LM can cover this or not?

5) Also in the laminar flow, I set the wall (inner membrane) uw as u2t and v2t (honestly I thought should be u2 and v2, it shows orange when set as u2 v2, but I see in Version 3.5, it is set as u2t and v2t), what is the meaning of of u2t, derivative or? I searched but with little explanation.

So can you please check my model and give me some suggestions? Thank you as usual!

Thank you so much!
Dear Dr. Ivar, 1) I am sorry I typed wrong, now I understand the difference between parameter and variable. You are right from the beginning. 2) Now I tried to add the plane strain model, is shows the error: "Undefined value found. - Detail: NaN_or_Inf_found_when_solving_linear_system_using_PARDISO' What is this error mean? Is it because my equations or boundary Conditions are not sufficient to make an unique solution, I should add the moving mesh? (But I want to let it works first then add another) 3) I tried to learn from the structure model tutorial in this website, unfortunately I don't have the MIES model, I read the pdf file and the user guide, still have lots of confusion with weak constrains. Do you have some suggestions to learn about weak constraint? 4) 'lm' should be applied to boundaries with Dirchlet condition between two physics, for my model, the inner membrane is set with body load u_lm and v_lm, for my understanding, the fluid and plane strain is related by a.) the pressure of the fluid on the membrane b.) the inner membrane velocity should be same as the fluid velocity at the inner membrane wall I am not sure LM can cover this or not? 5) Also in the laminar flow, I set the wall (inner membrane) uw as u2t and v2t (honestly I thought should be u2 and v2, it shows orange when set as u2 v2, but I see in Version 3.5, it is set as u2t and v2t), what is the meaning of of u2t, derivative or? I searched but with little explanation. So can you please check my model and give me some suggestions? Thank you as usual! Thank you so much!

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.