CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] open/close pipe in the middle (https://www.cfd-online.com/Forums/openfoam-meshing/217659-open-close-pipe-middle.html)

Kondorfa May 20, 2019 15:06

open/close pipe in the middle
 
Hi all,
In my simulation I have a pipe through which water runs and which I want to open and close somewhere within the pipe (not at its ends) at certain times. This should somehow be done with a dynamic mesh, but I can not find any tutorial or the like? Can someone help? I created the mesh on my own and can adapat it as necessary, but not during the simulation, so far :o

Kondorfa July 28, 2019 10:26

Baffles attachDetach mergeOrSplitBaffles stitchMesh
 
1 Attachment(s)
Hi all,


Some more insights into this problem. Maybe this helps to get some feedback :)


The pipe connects two pars of the domain and it should open and closed at certain times (See in the enclose image the white and red part forming the pipe. The red part extends the white part a little bit).



The mesh describing the pipe has been generated by snappyHexMesh.



With the follwing entry in topoSetDict:
actions
(
{
name splitFaces;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (-0.012 0.0654 -0.012)(0.012 0.066 0.012);
}
}

{
name splitFacesZone;
type faceZoneSet;
action new;
source setToFaceZone;
faceSet splitFaces;
}

I got the faceSet and the FacesZone that could open and close the pipe (see the green part in the image). They neatly extend along a cross section of the pipe.



With the createBaffles command and the follwing entries in the bafflesDict:
internalFacesOnly true;

baffles
{
baffleFaces
{
type faceZone;
zoneName splitFacesZone;

patches
{
master
{
name splitPipeSide;
type wall;
}
slave
{ name splitTankSide;
type wall;
}
}
}
}

I could obtain a master and slave patch. When they are sepearated the pipe is closed. When they are joined the pipe is open. Initially the pipe is closed, since after the createBaffles command the patches are sepatated.;)


Now, I can run the simulation with the pipe closed. It works.:D


I can use either the mergeOrSplitBaffles utility or the stitchMesh utility to join the patches (i.e. open the pipe) before the simulation starts. Then the simulation works with the pipe open.:D


So far no problems. But this is not what is needed, as I cannot switch the pipe during the simulation.:(


So, I let the simulation run for a while, kill it, run either the mergeOrSplitBaffles of stichMesh utility and restart the simulation. It even resumes, but when I run the reconstructPar (simulation is run in parallel) it crashes when trying to reconstruct the scalarfields. There is not even an error message nor does is terminate properly. It simply gets stuck and does not finish. So I cannot really "see" what the solver was doing after having joined the patches in the intermediate break.:mad:


I had a look at posts in this forum and found that the attachDetach in the DynamicMeshDict could help, but that it is not supported anymore since couple of years. An attempt to try to use the bugfix under: https://bugs.openfoam.org/view.php?id=572 did not work since the compilation fails all over in view of different other changes done in the meanwhile.:eek:


Has anyone an idea of how to get the pipe opened or closed during runtime?:confused:


Am I the only one with such a "problem"?:rolleyes:



Best
K.


All times are GMT -4. The time now is 14:00.