CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] Tutorials using dynamic mesh?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2014, 15:44
Default Tutorials using dynamic mesh?
  #1
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Hi,

I'm new to OpenFOAM and I wanted to learn about dynamic mesh's, mainly to simulate a simple system where I have a container with two openings and both are sealed with a valve. The container has a gas of some sort, e.g. air and it is heated by convection. When a specific pressure develops the exhaust valve opens and when more air is needed (pressure is too low), the intake valve opens. Think of it as a Stirling engine.

thanks
massive_turbulence is offline   Reply With Quote

Old   April 14, 2014, 13:40
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I see three ways of doing this:

1. Use the attachDetach mesh modifier. You will need to program your own class that activated the valve faces based on the pressure conditions you described.

2. Create boundary conditions that do the same calculation of internal average pressure and then change from the valueFraction (going from fixed gradient to fixed value), effectively switching from a wall to an inlet/outlet.

3. Do similar to option 2 but with fvOptions and regions.

In all three cases, there is some programming involved, as there isn't anything that will do what you are looking at by default, that I'm aware of.
mturcios777 is offline   Reply With Quote

Old   April 14, 2014, 15:29
Default
  #3
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
I see three ways of doing this:

1. Use the attachDetach mesh modifier. You will need to program your own class that activated the valve faces based on the pressure conditions you described.

2. Create boundary conditions that do the same calculation of internal average pressure and then change from the valueFraction (going from fixed gradient to fixed value), effectively switching from a wall to an inlet/outlet.

3. Do similar to option 2 but with fvOptions and regions.

In all three cases, there is some programming involved, as there isn't anything that will do what you are looking at by default, that I'm aware of.
1. Program with C++. You mean I would need to write a code, which I can do, I'm just not sure what the steps are. But ok... I looked at this thread

http://www.cfd-online.com/Forums/ope...achdetach.html

And I notice you said it's not compiled anymore. I suppose that means I need to rebuild openfoam myself but then how do I make sure it compiles with it?

Here's a butterfly valve simulation that is similar to what I'm thinking...
http://www.youtube.com/watch?v=WzWsUB79e-A

Looks super complicated...

2.This is the part that confuses me because I'm guessing that I would have to edit the blockmeshDict for the boundaries that don't move but what about the valves and lets pretend it's the butterfly valve simulation. Then how would a moving 'object' which is the circular shaped valve move around inside of the cylinder? Would I setup the valve inside the dynamicMeshDict? and then where do I tell the valve (to open) to rotate 90 degrees when the pressure is correct inside the cylinder. Lets just pretend there's only a cylinder and one valve.

Is the lid-driven cavity
http://openfoam.org/docs/user/cavity.php

related to this problem somehow, or is the lid simple open with air moving along the x-axis?
massive_turbulence is offline   Reply With Quote

Old   April 14, 2014, 16:07
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
For a simulation like the butterfly valve in the video, you would need to set up a AMI sliding mesh, like the one in the propeller tutorial for pimpleDyMFoam. The cases I described are abstracting the valve into something less computationally intense, since the valve would only have two states (open/close). Depending on what you want this may be enough.

However, having the a butterfly valve that reacts to pressure will require some extra programming since the default behaviour for solidBodyMotionFvMeshCoeffs is to specify a rotation speed for a certain area.

Long story short, if you want there to be some kind of feedback between the bulk property of the domain like average pressure and a moving zone/boundary conditions/mesh modifier, there will be programming involved. Unless you want to try swak4Foam (do a search on the forums).

Note that for attachDetach, there is no fvMesh that comes compiled with it, but I have tested it for OF2.0.x and above and it works well with everything except the new epsilonWallFunctions boundary for epsilon.
mturcios777 is offline   Reply With Quote

Old   April 14, 2014, 18:19
Default
  #5
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
For a simulation like the butterfly valve in the video, you would need to set up a AMI sliding mesh, like the one in the propeller tutorial for pimpleDyMFoam. The cases I described are abstracting the valve into something less computationally intense, since the valve would only have two states (open/close). Depending on what you want this may be enough.

However, having the a butterfly valve that reacts to pressure will require some extra programming since the default behaviour for solidBodyMotionFvMeshCoeffs is to specify a rotation speed for a certain area.

Long story short, if you want there to be some kind of feedback between the bulk property of the domain like average pressure and a moving zone/boundary conditions/mesh modifier, there will be programming involved. Unless you want to try swak4Foam (do a search on the forums).

Note that for attachDetach, there is no fvMesh that comes compiled with it, but I have tested it for OF2.0.x and above and it works well with everything except the new epsilonWallFunctions boundary for epsilon.

Okay... how about a simpler system (see attached image please)

http://www.cfd-online.com/Forums/att...1&d=1397510537

using an inlet and an outlet with valves on both ends in 2 dimensions. Basically it would consist of something like the cavity tutorial but with two openings that would join the main container (box) with pipes with a diameter of 1/10th the length of the wall that joins to the main body.

An external heat source would conduct heat into the cavity and cause the air pressure to increase when both valves are closed and after a certain time ( say after 1/2 second) the outlet valve opens for some small time (e.g. 1/8 second) and closes and the inlet valve opens at the same time when the outlet closes for 1/8 a second and the process repeats.

Is there a simple way to set this up?

thanks so far.
Attached Images
File Type: png simple_setup.png (3.4 KB, 121 views)
massive_turbulence is offline   Reply With Quote

Old   April 14, 2014, 18:37
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Somewhat simpler in 2D, but the method for modelling the valves themselves remains up in the air. The most important questions to ask is if you want to model your valve approximately using boundary conditions/source terms, or if you want to simulate the actual motion of the valves and how you want to actuate them. Both have their challenges, but once you have decided on the strategy you can then move forward. Good luck.
mturcios777 is offline   Reply With Quote

Old   April 14, 2014, 20:30
Default
  #7
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
Somewhat simpler in 2D, but the method for modelling the valves themselves remains up in the air. The most important questions to ask is if you want to model your valve approximately using boundary conditions/source terms, or if you want to simulate the actual motion of the valves and how you want to actuate them. Both have their challenges, but once you have decided on the strategy you can then move forward. Good luck.

I'm guessing the setup with changing source terms would be simpler. I would probably change one of the dictionary files to include an opening to the main boundary at given time intervals but I'm not sure if there's a simple example, any ideas?
massive_turbulence is offline   Reply With Quote

Reply

Tags
dynamic mesh, openfoam, stirling engine, valve simulation


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh on Pintle type injector. herntan FLUENT 16 September 4, 2020 09:27
Dynamic Mesh kennyboy FLUENT 1 February 23, 2019 02:52
Local mesh refinement definition in a DEFORMING dynamic mesh zone using Dynamic Mesh Emanuele88 FLUENT 0 February 9, 2016 12:39
dynamic mesh for drop interface IndrajitW FLUENT 0 March 30, 2013 09:03
dynamic mesh refinement and rhoCentralFoam ChrisA OpenFOAM Running, Solving & CFD 1 March 21, 2013 09:00


All times are GMT -4. The time now is 16:24.