# beamInCrossFlow FSI + magneticFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 12, 2021, 09:58 beamInCrossFlow FSI + magneticFoam #1 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 In solids4Foam, there is ~/tutorials/fluidSolidInteraction/beamInCrossFlow/OscillatingElasticBeam. So, the beam oscillates within a viscous fluid medium. Supposing that the beam has some magnetic properties, I am trying to oscillate the beam using external magnetic fields. I was wondering if this is possible through a combination of solids4Foam and magneticFoam! Thank you! Best regards

March 22, 2021, 07:24
#2
Super Moderator

Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 892
Rep Power: 29
Quote:
 Originally Posted by Deep1994 In solids4Foam, there is ~/tutorials/fluidSolidInteraction/beamInCrossFlow/OscillatingElasticBeam. So, the beam oscillates within a viscous fluid medium. Supposing that the beam has some magnetic properties, I am trying to oscillate the beam using external magnetic fields. I was wondering if this is possible through a combination of solids4Foam and magneticFoam! Thank you! Best regards
Hi,

It should be possible.

To check the concept, you can change the inlet to a wall in the oscillatingElasticBeam tutorial, then set the gravity in the solid to same largish number in the original flow direction. If you solve this case, then the beam will oscillate under gravity (body force) causing motion in the fluid.

If this all works fine then the next step would be to incorporate the magneticFoam equation into one of the solid models. I would start from thermalLinGeomSolid which sequentially solves the temperature equation and displacement equation. In that case a source term appears in the displacement equation from the temperature. So in the magnetic case you would replace the temperature equation with the magnetic equation which I guess will generate a body force source term in the displacement equation.

Philip

 March 22, 2021, 11:13 #3 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 Dear Philip, Thank you for replying! I have made the inlet as a wall. I've then changed the gravity to value (5 0 0) to see how the beam deforms over time along the x-direction. The beam does deform, but it doesn't oscillate in true terms! To visualize an oscillation just using the gravity (body) force, I need to say give an oscillating force field, something that varies sinusoidally (for example). Could you please tell me how to incorporate this temporal variation of g? g = (5*sin(2*time) 0 0) does not seem to work! Please tell me how I could "code" this change? Best regards, Ratnadeep

 March 22, 2021, 17:22 #4 Super Moderator     Philip Cardiff Join Date: Mar 2009 Location: Dublin, Ireland Posts: 892 Rep Power: 29 You can see the displacement equation for the linGeomTotalDispSolid solid model in the evolve function of solids4foam/src/solids4FoamModels/solidModels/linGeomTotalDispSolid/linGeomTotalDispSolid.C: Code: ``` fvVectorMatrix DEqn ( rho()*fvm::d2dt2(D()) == fvm::laplacian(impKf_, D(), "laplacian(DD,D)") - fvc::laplacian(impKf_, D(), "laplacian(DD,D)") + fvc::div(sigma(), "div(sigma)") + rho()*g() + stabilisation().stabilisation(D(), gradD(), impK_) );``` So you can create an oscillating vector force and add it to the equation, where you create and update it outside the outer loop e.g. Code: ``` // Time-varying body force const dimensionedVector timeVaryingBodyForce ( "timeVaryingBodyForce", dimLength*dimLength/dimTime, vector(5*Foam::sin(2.0*runTime().value()), 0.0, 0.0) ); // Momentum equation loop do { ... fvVectorMatrix DEqn ( rho()*fvm::d2dt2(D()) == fvm::laplacian(impKf_, D(), "laplacian(DD,D)") - fvc::laplacian(impKf_, D(), "laplacian(DD,D)") + fvc::div(sigma(), "div(sigma)") + rho()*g() + rho()*timeVaryingBodyForce + stabilisation().stabilisation(D(), gradD(), impK_) );``` Philip

 March 22, 2021, 23:09 #5 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 Dear Philip, Thank you for your reply. I have tried 'exactly' as you mentioned. However, I do not see any effect of this change on the output/result. It looks as if the simulation is lacking this change of information. Maybe could I do/try something more in the TimeVaryingBodyForce anecdote? Could you please help me resolve this issue! Best regards, Philip

March 23, 2021, 06:21
#6
Super Moderator

Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 892
Rep Power: 29
Quote:
 Originally Posted by Deep1994 Dear Philip, Thank you for your reply. I have tried 'exactly' as you mentioned. However, I do not see any effect of this change on the output/result. It looks as if the simulation is lacking this change of information. Maybe could I do/try something more in the TimeVaryingBodyForce anecdote? Could you please help me resolve this issue! Best regards, Philip
Did you compile the code after making the changes? i.e. using "wmake libso".

 March 23, 2021, 06:59 #7 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 Dear Philip, I am sorry I did not do that; please could you tell me in which directory (or path) should I need to run this command? kindly tell me the steps that I should have to follow sequentially, so as to compile the simulation. Best regards, Ratnadeep

 March 23, 2021, 07:37 #8 Super Moderator     Philip Cardiff Join Date: Mar 2009 Location: Dublin, Ireland Posts: 892 Rep Power: 29 I suggest you go through some tutorials on coding in OpenFOAM first e.g. https://wiki.openfoam.com/Programming; then if you specific questions related to solids4foam, you can post again here. Philip

 March 23, 2021, 09:12 #9 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 Sure Philip, this website shall be helpful of course. Thanks!

 March 23, 2021, 09:13 immersed boundary method in foam-extend #10 New Member   Join Date: Mar 2021 Posts: 9 Rep Power: 2 Dear Philip, I was just wondering if foam-extend 4.0 (or solids4foam) has the immersed boundary solver for large deformation fluid-structure interaction. Since there is a mesh degradation/distortion during large deformation, I was willing to use non-conformal meshes, however, solids4foam FSI has conformal meshes (ALE) I guess. Could you kindly suggest to me something about this? Finally, does solids4Foam always use conformal meshes for FSI problems? Is there any tutorial/case setup for FSI with non-conformal mesh?