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.

Comsol-elementary question

Please login with a confirmed email address before reporting spam

I'm new to comsol and I'm trying to model the flow of three spheres connected by two movable rods in a stationery fluid. There is relative motion between the spheres as the rods move to and fro.
I'm trying to analyze the motion of this sphere-rod system in the fluid.
How do I make the fluid stationery while the rods move? Do I model the rods as walls with slip condition? If I do that, how do I make the sphere move along with the corresponding rod?


9 Replies Last Post Apr 22, 2012, 11:42 p.m. EDT
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 Apr 12, 2010, 3:01 p.m. EDT
Hi

I would suggest to start "easy", although mixing 2 physics like that is already challenging, particularly if you are a beginner, but its good to have challenging goals, at least so long you do not despair.

So I would start just with one, two, three spheres, forget the rods and the fluid to begin with, and find the way to enforce linear motion of the two external spheres, if they are moving in a symmetric way, you could consider just one half, by symmetry (calculates quicker, and is hence easier to debug in the beginning, one can always mirror the geometry later and continue with a full model). Then should youattach them with a "spring" to allow oscillations and harmonic analysis.

Once comortable with these simpler models (stationary, transient and harmonic), then only add the fluid and continue wit coupled physics.

A nice project you have there

Have fun Comsoling
Ivar

PS do not forget to go back to the doc regularly, and do some of the exercices in between, they help to get the feeling for mixng the physics, or just setting up complex models.
Hi I would suggest to start "easy", although mixing 2 physics like that is already challenging, particularly if you are a beginner, but its good to have challenging goals, at least so long you do not despair. So I would start just with one, two, three spheres, forget the rods and the fluid to begin with, and find the way to enforce linear motion of the two external spheres, if they are moving in a symmetric way, you could consider just one half, by symmetry (calculates quicker, and is hence easier to debug in the beginning, one can always mirror the geometry later and continue with a full model). Then should youattach them with a "spring" to allow oscillations and harmonic analysis. Once comortable with these simpler models (stationary, transient and harmonic), then only add the fluid and continue wit coupled physics. A nice project you have there Have fun Comsoling Ivar PS do not forget to go back to the doc regularly, and do some of the exercices in between, they help to get the feeling for mixng the physics, or just setting up complex models.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 12:37 a.m. EDT
Thanks a lot for the quick reply.
So, I have to use two springs between the spheres. Will lines work as springs?
How do I model springs and how do I make the spheres move along with the springs?
Thanks a lot for the quick reply. So, I have to use two springs between the spheres. Will lines work as springs? How do I model springs and how do I make the spheres move along with the springs?

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 Apr 13, 2010, 2:44 a.m. EDT
Hi

Well first I would start in 2D, then you are not really simulating spheres but 1[m] long cylinders, this is again because you can simulate quickly, less than a minute and you can learn better this way, then you might go to 3D, but you could come up in hours of calculations at the end.

So start Comsol in 2D - Structural - Plain Strain (ie pn or smpn), and draw a circle of radius "1" at x=1.5, y=0 (or choose any dimension that fits you better).

You need to define the material of the shpere: "Physics - Subdomain settings - Material tab", let us say its aluminium E 70[GPa] nu 0.3 rho 2750[kg/m^3], thickness (the Z depth leave it default to 1 [m].

There are different ways to enforce motion and attach "springs", but first you must force your spheres to move only along one direction. Constraining the correct boundary conditions (if its along "x") you should set the "v" variable to 0 (select the boundary of your circle in "pn" or "smpn" (if you have the structural modus) and in the boundary conditions you select the boundaries (1,2,3,4 if ou have one circle) and tick Ry=0 and OK and you circle is blocke along the X direction.

Then if you want to attach a spring you must decide where, probably the CoG (centre of gravity), this point you must calculate where it is: "Options - Integraton Coupling variables - Boundary variables"

you select your four boundaries: you fill in "name" and "expression" fields (the rest leave as by defualt) as:

Length 1
X0x x/Length
X0u u/Length

This means that Length is the length (integration of "1" along the circuimference) of your circle = 2*pi*r in this case, but like this your equations are self supporting, if you later decide to change the sizes or scale something, the formulas remain valid as Comsol recalculates everything.
X0x is the integration along the circonference of x, normalised by the length, hence its the mean "x" position of your circle before motion, while X0u is the mean motion DISPLACEMENT, hence X0x+X0u is the position of the centre of gravity after (or during in transient mode) the displacement.

Now you add the spring. Let's say it has a stiffnes of Ks[N/m], the force you excerce (along x) is
Fx = -Ks*u

the product of the spring constant times the displacement divided by the length as the units are normalised as pressures, as this is a restoring force it has a negative sign.
You can put this as a load on the circle boundary (or the full volume, think over and/or test the differences, with "u" or with "X0u" what are the differences ?).
This means that you go to the "Physics - boundary settings - Load tab" and you type -Ks*u/Length for "Fx" important note : check the "Edge load is define ...force/length", then OK.

But "Ks" is not yet defined for COMSOL, this must be done so yuo go to the constants (double click on the Model tree or "Options - Constants" you fill in name and expression:

Ks 1000[kN/m]

I have put any number in here, pls change at your will, the units are important as they help to check the formulas in COMSOL I have selecte "kiloNewton per meter" (even if some functionalities as the Integration variables do not yet transfer correctly the units, and these appread "red").

You are now ready to do a harmonic analysis like this: "Physics - Properties - Analysis type Eigenfrequency" OK and you hit "solve" its the "=" sign. I see 1.7[Hz] the first mode of the spring mass system (the displacement are arbitrary just forget them in eigenfreqy mode.

To obseve the displacements you need to "Postprocessing - Plot parameters select Deformed shapes tick ON" and do an "apply", then select the "Surface" tab and use the predefined quantities and selec x in units "mm". There it is.

Next is perhaps to add a gravity and see the spring expansion, adding gravity means you will add a body force (nowe in comsol you do not add forces [N] but pressures [Pa=N/m^2], but a pressure is nothing else than a normalised Force over area): Go to "Physics - subdomain settings", select your volume "1" and go to the "Load" tab. You now add a gravity along "+x" (because you have bocked the Y direction we need to use X direction to see any effect) and you select Fx = rho_pn*G (or rho_smpn*G if you are in smpn mode), we need to define the "G" "Options -constants" G 1[lbf/lb] OK the [lbf/lb] is just a "trick" to quickly get the gravity acceleration as the ratio of the imperial units "pond force divided by a pound", it is already inside COMSOL but you can also type in 9.81[m/s^2], or whatever you want. Do not forget to check the units:rho[kg/m^3*m/s^2=N/m^3] and be sure you hgave ticked "Body load ... using the thickness".

You select "Physics - Properties Analysis type: Static" OK and Solve OK I get some 84.7[mm]. this should be checked, but for that I need the total mass of the cylinder (again it's 1[m] by default long in "2D"). To have comsol calculating the value, now that you have solved, eveerything is there: Postprocessing Subdomain integration Expression: replace the default "mises" by "rho" the density. Note the full expression is rho_pn or rho_smpn depending on the COMSOL application mode running (its written in the GUI title and its what you selected at the beginning). I'm now calulating the linear 2D density by integrating the density over the cercle area nad the units are kg/m (depth alongZ). But I want the full mass so in fact I must write:
rho_pn*thickness_pn. Thickness_pn is defined as "thickness, the last line in the "physics - subdomain settings - Material tab" where you have the other material data. I get some 8639.4[kg], As I'm lazy I want the force in Newton so I recalculate the full formula "rho_pn*thickness_pn*G" and read 84723[N].

Next is to check that with a spring constant of 1[MN/m] I get really some 38.5mm displacement, as F=Ks*x. I can also check the spring first eigenfrequency => f=1/2/pi*sqrt(Ks/Mass) =

As I'm lazy I said, I go to "Options - Integration Coupling Variables - Subdomain Variables" I select my volume "1" and I write:

Volume = 1*thickness_pn
Mass = rho_pn*thickness_pn

Then OK and in "Options - Integration Coupling Variables - Point Variables"

Fr = 1/2/pi*sqrt(Ks/Mass)
Dx = Mass*G/Ks

without the "=" use the tab to change colums, end with OK

When you change these values you must "update the model" to get them active: "Solve - Update Model"
then you have them for later, to read them out (as these case sensitive names are now globally defined) I select "Postprcessing - Point evaluation" and I type the expression Volume "Apply" then , Mass "Apply" , etc for Fr and Dx. The results appear in the log window at the bottom of the GUI.

Final test: transent time dependent. As nothing is changing with time here we need to define some perturbation, such as a small force for some fraction of a second. "Physics - Properties - Analysis mode Transient", this turns on the variable t = time. Then "Physics - Subdomain settings - Load" we have alread the gravity load, so we can play with physics and say it applies only durig 100[ms] as a half sinus: so I replace the Fx by "rho_pn*G*sin(pi*t/t0)*(t<t0)" and I go to the constants to define t0 = 100[ms]. Then "Solve - Solver parameters" in the time tab i write in "range(0,0.025,1)" (you can also use the "edit" button, OK and Solve => "=". You will now see the last "frame at t=1[s]. To see the other positions you need to go to "Postprocessing - Plot Parameters - General tab" and change the" Solution attime" and then Apply. You can also test an "Animation"

Now its up to you to continue, if you do not get the same results as me its probably because you have missed a point, just as I had to correct a couple of times my post as I also mistyped a few things and got the simulation first wrong: => lessons alsways validate and check your models.

Have fun Comsoling
Ivar
Hi Well first I would start in 2D, then you are not really simulating spheres but 1[m] long cylinders, this is again because you can simulate quickly, less than a minute and you can learn better this way, then you might go to 3D, but you could come up in hours of calculations at the end. So start Comsol in 2D - Structural - Plain Strain (ie pn or smpn), and draw a circle of radius "1" at x=1.5, y=0 (or choose any dimension that fits you better). You need to define the material of the shpere: "Physics - Subdomain settings - Material tab", let us say its aluminium E 70[GPa] nu 0.3 rho 2750[kg/m^3], thickness (the Z depth leave it default to 1 [m]. There are different ways to enforce motion and attach "springs", but first you must force your spheres to move only along one direction. Constraining the correct boundary conditions (if its along "x") you should set the "v" variable to 0 (select the boundary of your circle in "pn" or "smpn" (if you have the structural modus) and in the boundary conditions you select the boundaries (1,2,3,4 if ou have one circle) and tick Ry=0 and OK and you circle is blocke along the X direction. Then if you want to attach a spring you must decide where, probably the CoG (centre of gravity), this point you must calculate where it is: "Options - Integraton Coupling variables - Boundary variables" you select your four boundaries: you fill in "name" and "expression" fields (the rest leave as by defualt) as: Length 1 X0x x/Length X0u u/Length This means that Length is the length (integration of "1" along the circuimference) of your circle = 2*pi*r in this case, but like this your equations are self supporting, if you later decide to change the sizes or scale something, the formulas remain valid as Comsol recalculates everything. X0x is the integration along the circonference of x, normalised by the length, hence its the mean "x" position of your circle before motion, while X0u is the mean motion DISPLACEMENT, hence X0x+X0u is the position of the centre of gravity after (or during in transient mode) the displacement. Now you add the spring. Let's say it has a stiffnes of Ks[N/m], the force you excerce (along x) is Fx = -Ks*u the product of the spring constant times the displacement divided by the length as the units are normalised as pressures, as this is a restoring force it has a negative sign. You can put this as a load on the circle boundary (or the full volume, think over and/or test the differences, with "u" or with "X0u" what are the differences ?). This means that you go to the "Physics - boundary settings - Load tab" and you type -Ks*u/Length for "Fx" important note : check the "Edge load is define ...force/length", then OK. But "Ks" is not yet defined for COMSOL, this must be done so yuo go to the constants (double click on the Model tree or "Options - Constants" you fill in name and expression: Ks 1000[kN/m] I have put any number in here, pls change at your will, the units are important as they help to check the formulas in COMSOL I have selecte "kiloNewton per meter" (even if some functionalities as the Integration variables do not yet transfer correctly the units, and these appread "red"). You are now ready to do a harmonic analysis like this: "Physics - Properties - Analysis type Eigenfrequency" OK and you hit "solve" its the "=" sign. I see 1.7[Hz] the first mode of the spring mass system (the displacement are arbitrary just forget them in eigenfreqy mode. To obseve the displacements you need to "Postprocessing - Plot parameters select Deformed shapes tick ON" and do an "apply", then select the "Surface" tab and use the predefined quantities and selec x in units "mm". There it is. Next is perhaps to add a gravity and see the spring expansion, adding gravity means you will add a body force (nowe in comsol you do not add forces [N] but pressures [Pa=N/m^2], but a pressure is nothing else than a normalised Force over area): Go to "Physics - subdomain settings", select your volume "1" and go to the "Load" tab. You now add a gravity along "+x" (because you have bocked the Y direction we need to use X direction to see any effect) and you select Fx = rho_pn*G (or rho_smpn*G if you are in smpn mode), we need to define the "G" "Options -constants" G 1[lbf/lb] OK the [lbf/lb] is just a "trick" to quickly get the gravity acceleration as the ratio of the imperial units "pond force divided by a pound", it is already inside COMSOL but you can also type in 9.81[m/s^2], or whatever you want. Do not forget to check the units:rho[kg/m^3*m/s^2=N/m^3] and be sure you hgave ticked "Body load ... using the thickness". You select "Physics - Properties Analysis type: Static" OK and Solve OK I get some 84.7[mm]. this should be checked, but for that I need the total mass of the cylinder (again it's 1[m] by default long in "2D"). To have comsol calculating the value, now that you have solved, eveerything is there: Postprocessing Subdomain integration Expression: replace the default "mises" by "rho" the density. Note the full expression is rho_pn or rho_smpn depending on the COMSOL application mode running (its written in the GUI title and its what you selected at the beginning). I'm now calulating the linear 2D density by integrating the density over the cercle area nad the units are kg/m (depth alongZ). But I want the full mass so in fact I must write: rho_pn*thickness_pn. Thickness_pn is defined as "thickness, the last line in the "physics - subdomain settings - Material tab" where you have the other material data. I get some 8639.4[kg], As I'm lazy I want the force in Newton so I recalculate the full formula "rho_pn*thickness_pn*G" and read 84723[N]. Next is to check that with a spring constant of 1[MN/m] I get really some 38.5mm displacement, as F=Ks*x. I can also check the spring first eigenfrequency => f=1/2/pi*sqrt(Ks/Mass) = As I'm lazy I said, I go to "Options - Integration Coupling Variables - Subdomain Variables" I select my volume "1" and I write: Volume = 1*thickness_pn Mass = rho_pn*thickness_pn Then OK and in "Options - Integration Coupling Variables - Point Variables" Fr = 1/2/pi*sqrt(Ks/Mass) Dx = Mass*G/Ks without the "=" use the tab to change colums, end with OK When you change these values you must "update the model" to get them active: "Solve - Update Model" then you have them for later, to read them out (as these case sensitive names are now globally defined) I select "Postprcessing - Point evaluation" and I type the expression Volume "Apply" then , Mass "Apply" , etc for Fr and Dx. The results appear in the log window at the bottom of the GUI. Final test: transent time dependent. As nothing is changing with time here we need to define some perturbation, such as a small force for some fraction of a second. "Physics - Properties - Analysis mode Transient", this turns on the variable t = time. Then "Physics - Subdomain settings - Load" we have alread the gravity load, so we can play with physics and say it applies only durig 100[ms] as a half sinus: so I replace the Fx by "rho_pn*G*sin(pi*t/t0)*(t lessons alsways validate and check your models. Have fun Comsoling Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 1:26 p.m. EDT
Ivar,

Thanks a lot. You have been really helpful.
I will get back and post my results as soon as I have them.
Ivar, Thanks a lot. You have been really helpful. I will get back and post my results as soon as I have them.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 14, 2010, 2:05 a.m. EDT
I tried to model the problem using the structural mechanics module and then the fluid mechanics module, but I've had no luck so far on how to blend both of them. I can't get to apply the forces in the fluid mechanics module and on the other hand if I include the subdomain of the solid in the fluid module, it asks for the viscosity of the solid.
Similar problem occurs if I try to include the fluid subdomain in the mechanics module where it asks for the young's modulus of the liquid, which again is meaningless. So these methods won't work as far as I could figure out.
The closest I could get was using the MEMS > Fluid structure interaction module where I was able to separate the soild and the liquid domains. But I'm afraid that the meshing won't hold up, if I give large displacements.

Also, I keep getting an error 7300 which says "Pointwise constraints for time-derivatives are not supported" when I try to solve a problem with small displacements using a moving mesh (ALE).
I tried to model the problem using the structural mechanics module and then the fluid mechanics module, but I've had no luck so far on how to blend both of them. I can't get to apply the forces in the fluid mechanics module and on the other hand if I include the subdomain of the solid in the fluid module, it asks for the viscosity of the solid. Similar problem occurs if I try to include the fluid subdomain in the mechanics module where it asks for the young's modulus of the liquid, which again is meaningless. So these methods won't work as far as I could figure out. The closest I could get was using the MEMS > Fluid structure interaction module where I was able to separate the soild and the liquid domains. But I'm afraid that the meshing won't hold up, if I give large displacements. Also, I keep getting an error 7300 which says "Pointwise constraints for time-derivatives are not supported" when I try to solve a problem with small displacements using a moving mesh (ALE).

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 Apr 14, 2010, 5:49 a.m. EDT
Hi

A couple of things, coupling physics, specially structural fluidic is tricky, start frst with a couple of the good examples in the model libary,try out the exercices in the books, before starting your nice project, you will progress quicker like that, in my view.

Yes when you couple phyiscs you must deactiv some domains in the different modules and link "by hand the physics", in the mems modus there are a few predefined modes, but you must also understand the different operation required to follow the predefined settings, thisis well described in the documentation.

Concerning error 7300, as I remember it has to do with point constraints and transient mode, if you define a constraint on a single point it is singularity, and if COMSOL needs a derivative (which is often the case for the solvers) then it cannot make any derivative as a derivative is defined over a finite area, and you are restained to a "point". Check your boundary conditions, and find a way to distribute the force or constraints over an area, or a volume, or even an edge, instead of on a single point.

hope this helps

Ivar
Hi A couple of things, coupling physics, specially structural fluidic is tricky, start frst with a couple of the good examples in the model libary,try out the exercices in the books, before starting your nice project, you will progress quicker like that, in my view. Yes when you couple phyiscs you must deactiv some domains in the different modules and link "by hand the physics", in the mems modus there are a few predefined modes, but you must also understand the different operation required to follow the predefined settings, thisis well described in the documentation. Concerning error 7300, as I remember it has to do with point constraints and transient mode, if you define a constraint on a single point it is singularity, and if COMSOL needs a derivative (which is often the case for the solvers) then it cannot make any derivative as a derivative is defined over a finite area, and you are restained to a "point". Check your boundary conditions, and find a way to distribute the force or constraints over an area, or a volume, or even an edge, instead of on a single point. hope this helps Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 27, 2011, 4:22 p.m. EDT
hi ivar,
i am getting ('Pointwise constraints for time derivatives are not supported' ) error. i cheked boundry condition and geometry as well.i am working on comsol 4.1.i have attched my model with this post.plz give me suggestion in it..






thanks,

rakesh patel
hi ivar, i am getting ('Pointwise constraints for time derivatives are not supported' ) error. i cheked boundry condition and geometry as well.i am working on comsol 4.1.i have attched my model with this post.plz give me suggestion in it.. thanks, rakesh patel


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 Apr 27, 2011, 5:30 p.m. EDT
Hi

first of all, clean up the model, get rid of all unused nodes (empty definition items), these might bring in errors and make life far more difficult for you to debug, the same for solvers. Then when you change many things, it's worth to "delete Solver Sequences" and restart fresh (note that this deletes also all plot linked to the solution).

There are many constants defined in COMSOL, they all have names finishing with "_const" such as g_const=9.81[m/s^2], epsilon0_const ...

Do not use Point loads, particularly not in transient analysis, as these are singularities, and does not allow for any clear Jacobian evaluation, which is important for the solver process.

For me you are starting with a rather complex multi-physics case, you should really go step by step, first solve only structural, then only fluids, finally couple both, as it becomes very difficult to debug like that

Finally consider to update to last version/patch 3, see the main site

--
Good luck
Ivar
Hi first of all, clean up the model, get rid of all unused nodes (empty definition items), these might bring in errors and make life far more difficult for you to debug, the same for solvers. Then when you change many things, it's worth to "delete Solver Sequences" and restart fresh (note that this deletes also all plot linked to the solution). There are many constants defined in COMSOL, they all have names finishing with "_const" such as g_const=9.81[m/s^2], epsilon0_const ... Do not use Point loads, particularly not in transient analysis, as these are singularities, and does not allow for any clear Jacobian evaluation, which is important for the solver process. For me you are starting with a rather complex multi-physics case, you should really go step by step, first solve only structural, then only fluids, finally couple both, as it becomes very difficult to debug like that Finally consider to update to last version/patch 3, see the main site -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 22, 2012, 11:42 p.m. EDT
Hello lvar

In my simulation occurs to encounter difficulties like this. But my simulation is including structural mechanics module and emqa (quasi-statics, Magnetic / Perpendicular Induction Currents, Vector Potential)
Permanent magnet moving by spring using the structural mechanics module. And I added emqa. In this case, necessitated to give some value (remanent flux density, Relative permeability and constitutive relation etc. in the subdomain settings) of permanent magnet and conductivity material.
I am trying to use moving mesh ALE when blend both them. In my understood when I couple physics I must deactivate some domains in the different modules. But I am afraid, it is not possible. I think
What must I to do?
How do I make the induced eddy current in the conductivity material while the permanent magnet move?

Thanks

Su
Hello lvar In my simulation occurs to encounter difficulties like this. But my simulation is including structural mechanics module and emqa (quasi-statics, Magnetic / Perpendicular Induction Currents, Vector Potential) Permanent magnet moving by spring using the structural mechanics module. And I added emqa. In this case, necessitated to give some value (remanent flux density, Relative permeability and constitutive relation etc. in the subdomain settings) of permanent magnet and conductivity material. I am trying to use moving mesh ALE when blend both them. In my understood when I couple physics I must deactivate some domains in the different modules. But I am afraid, it is not possible. I think What must I to do? How do I make the induced eddy current in the conductivity material while the permanent magnet move? Thanks Su

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.