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

Dynamic Mesh Refinement + twoLiquidMixingFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 12, 2017, 02:43
Default Dynamic Mesh Refinement + twoLiquidMixingFoam
  #1
New Member
 
Join Date: Feb 2017
Posts: 6
Rep Power: 2
ashama is on a distinguished road
Good morning

I am working with a model for microfluidic mixing using the twoLiquidMixingFoam solver. I am curious to know if there is a way to implement the dynamicMesh with this solver. I need to improve the quality of my soultion without having to use a very fine and unreasonable mesh. Is there some tutorials around about this?

Thanks
ashama is offline   Reply With Quote

Old   May 12, 2017, 02:50
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13
floquation will become famous soon enough
I do not know of any tutorials on how to do that.

However, if you simply open both interFoam and interDyMFoam and your "twoLiquidMixingDyMFoam" solver, then by direct comparison between interFoam and interDyMFoam you should be able to implement it into your "twoLiquidMixingDyMFoam".

(The only difference between interFoam and interDyMFoam is the "DyM" part: dynamic mesh.)
floquation is offline   Reply With Quote

Old   May 15, 2017, 09:27
Smile
  #3
New Member
 
Join Date: Feb 2017
Posts: 6
Rep Power: 2
ashama is on a distinguished road
Quote:
Originally Posted by floquation View Post
I do not know of any tutorials on how to do that.

However, if you simply open both interFoam and interDyMFoam and your "twoLiquidMixingDyMFoam" solver, then by direct comparison between interFoam and interDyMFoam you should be able to implement it into your "twoLiquidMixingDyMFoam".

(The only difference between interFoam and interDyMFoam is the "DyM" part: dynamic mesh.)
Thanks for this info, I will try to do it and if I managed I will back to posted it here.

I need yr help in another question.

Do you know a way to do dynamicMeshRefinement and solidBodyMotionFvMesh at the same time, I mean I want to move a part of the Mesh plus refining the mesh for alpha field at the same time, if you know a tutorial or a previous post about this since I am drowned in searching w/o a useful result.

Thanks, have a nice day
ashama is offline   Reply With Quote

Old   May 16, 2017, 03:06
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 245
Rep Power: 13
floquation will become famous soon enough
Quote:
Originally Posted by ashama View Post
I need yr help in another question.

Do you know a way to do dynamicMeshRefinement and solidBodyMotionFvMesh at the same time, I mean I want to move a part of the Mesh plus refining the mesh for alpha field at the same time, if you know a tutorial or a previous post about this since I am drowned in searching w/o a useful result.
I'm sorry, but no, I have not seen such a thing before.
Evidently, that does not mean it does not exist, as I simply have never used/searched for solidBodyMotionFvMesh.

When I quickly look at interDyMFoam, I see that the following mesh methods are called:
Code:
mesh.update() // calculate mesh motion in the child (so dynamicRefineFvMesh or solidBodyMotionFvMesh)
mesh.changing() // implemented by polyMesh, returns "true" if the mesh changed

// And just some getters:
mesh.C()
mesh.Cf()
mesh.Sf()
In other words, it's all about mesh.update().

Now, if you wish to combine them, there is one hurdle to overcome: your simulation uses only one mesh.
You could create a wrapper class like:
Code:
class wrapperFvMesh : public dynamicFvMesh
{

private :
    dynamicRefineFvMesh refineMesh;
    solidBodyMotionFvMesh motionMesh;

public:
    bool update(){
        motionMesh.update()
        refineMesh.update()
    }

    // And a constructor and whatever you need ...

}
to simply pass the update() call to both meshes.
However, the problem is that those will be two different meshes, which are also different than your wrapperFvMesh.
Therefore, this will not work...
After all, your simulation will use wrapperFvMesh, which will never be updated!

In other words, the only way to combine them, is to break them down first.
I'd take all methods of dynamicRefineFvMesh to myDynamicRefineFvMeshMethods which is a new class that does not inherit from dynamicFvMesh. That is, it should not be a mesh object.
Rather, all methods should take the actual mesh (which would be your wrapperFvMesh) as an argument; or set a pointer in the constructor of the my...Methods class.
Now, if you do the same for solidBodyMotionFvMesh, you will end up with two calculator classes that can apply the calculations to the same mesh: your wrapperFvMesh.

In the end, all you have to change then is all references to "*this" should become "*mesh"..., because "*this" is no longer the mesh, but your mesh-pointer will be.
Then, any calls to mesh methods, should be forwarded to your mesh pointer.
It will be a challenge, but that way it should be quite feasible.
I strongly recommend using an IDE (e.g.: [1] [2]) for making such changes, as it will be able to tell you immediately which are the "mesh methods" that you should forward etc.
floquation 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
snappyHexMesh can't create refimenet region clktp OpenFOAM Native Meshers: snappyHexMesh and Others 2 September 14, 2016 11:08
very bad quality snapped mesh federicabi OpenFOAM Native Meshers: snappyHexMesh and Others 17 August 9, 2016 06:50
[ICEM] 3D Dynamic Mesh - Boundary layer mesh issues nathanricks ANSYS Meshing & Geometry 0 September 23, 2015 05:14
snappyHexMesh sticking point natty_king OpenFOAM Native Meshers: snappyHexMesh and Others 2 April 17, 2014 01:24
How to know mesh size after dynamic refinement tayo OpenFOAM 16 May 22, 2013 13:39


All times are GMT -4. The time now is 21:06.