CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

twoStrokeEngine and floating objects

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

Like Tree2Likes
  • 1 Post By kalle
  • 1 Post By kalle

Reply
 
LinkBack Thread Tools Display Modes
Old   October 18, 2012, 02:13
Default twoStrokeEngine and floating objects
  #1
New Member
 
Join Date: Jul 2011
Posts: 19
Rep Power: 6
of_user_ is on a distinguished road
Hello friends!

I am going to solve a cfd problem similar to a two-stroke engine. Before i am going to start i would like to ask the more experienced users: is this possible to do with openfoam or should i go for another cfd tool?

Similar case:

A similar case is the two-stroke engine from this thesis:

http://www.tfd.chalmers.se/~hani/pdf...sterThesis.pdf

The difference:

The pistonhead should not use a given velocity as a boundary condition. Instead the pistonhead should be modeled as a solid body (with mass/inertia).

Is it possible to use objects from the twoStrokeEngine-library for the mesh deformation, piston layering and the sliding interfaces in combination with the piston being a floating object?

Thank you for your help!
Best regards!
of_user_ is offline   Reply With Quote

Old   October 18, 2012, 02:42
Default
  #2
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Hi,

This can be done with Openfoam, but it might require you to do some programming. The twostroke classes in of1.6-ext uses the functions you need, but I would build my own fvMesh class based on the linearValveLayersFvMesh class (which uses the same functions), and implement the inertia based motion into the linearValveLayersFvMesh::newPoints() method in linearValveLayersFvMesh.C.

It can be parallelized (with constraints on partitioning), but you will have to rewrite the linearValveLayersFvMesh class for that.

This cannot currently be done with 2.1.x with the same ease.

Good luck,
K
of_user_ likes this.
kalle is offline   Reply With Quote

Old   October 18, 2012, 04:20
Default
  #3
New Member
 
Join Date: Jul 2011
Posts: 19
Rep Power: 6
of_user_ is on a distinguished road
Thank you for your fast answer kalle! I have one more question for you

Do you think this can be done with entry level C++ skills?

For applying the floating object movement to linearValveLayersFvMesh::newPoints() i would do it like this:

original code for linearValveLayersFvMesh::newPoints()
Code:
00307 Foam::tmp<Foam::pointField> Foam::linearValveLayersFvMesh::newPoints() const
00308 {
00309     tmp<pointField> tnewPoints
00310     (
00311         new pointField(points())
00312     );
00313 
00314     pointField& np = tnewPoints();
00315 
00316     const word layerPatchName
00317     (
00318         motionDict_.subDict("layer").lookup("patch")
00319     );
00320 
00321     const polyPatch& layerPatch = boundaryMesh()[layerPatchName];
00322 
00323     const labelList& patchPoints = layerPatch.meshPoints();
00324 
00325     const vector vel
00326     (
00327         motionDict_.lookup("pistonVelocity")
00328     );
00329 
00330     forAll(patchPoints, ppI)
00331     {
00332         np[patchPoints[ppI]] += vel*time().deltaTValue();
00333     }
00334 
00335     return tnewPoints;
00336 }
I would change this part:
Code:
00325     const vector vel
00326     (
00327         motionDict_.lookup("pistonVelocity")
00328     );
to use the velocity at the surface of the floating object (pistonhead) for the current timestep, instead of a constant value from the motionDict.

Will it really be this easy? Just by editing existing code? Or do i have to write my own methods/objects to solve this problem?

/edit: This code fragments may be from OF version 2.x.x
of_user_ is offline   Reply With Quote

Old   October 18, 2012, 05:17
Default
  #4
New Member
 
Join Date: Jul 2011
Posts: 19
Rep Power: 6
of_user_ is on a distinguished road
And i have one more question:

Is it possible for a floating solid object to collide with another solid object in openfoam? (Lets say an object is welded on top of the piston. I would like this object to collide with the top of the cylinder.)

If yes: How are the cells between those two objects treated? Will there remain one layer between the two solid bodies?
of_user_ is offline   Reply With Quote

Old   October 19, 2012, 01:42
Default
  #5
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Hi,

Yes, something like that was what I had in mind, using Newtons 2nd law to calulcate the velocity instead of looking it up.

I do not know how and if this is possible out-of-the box using 2.1.x. I would go for 1.6-ext on this one.

If you want some collision in your domain you get the problem that you have to completely remove some cells and merge some boundary faces. The problem is similar to a closing valve, which is usually handled by using different meshes. Hence stopping the simulation, mapping the results, and continue solving on the new mesh.

K
of_user_ likes this.
kalle is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:05.