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

2D problems

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By AtoHM
  • 1 Post By AtoHM

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2024, 06:56
Default 2D problems
  #1
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Hello all,


In OF we see a lot of tutorials using 2D cases (pitzDaily, cavity, etc...), but this problems don't use any internal geometry, like the 3D case of motorBike. In my problem, I want to simulate a tube immersed in a fluid, which due its symmetry I can simulate in 2D, like in the figure below. I was able to do the 3D case, by using snappyHexMesh (like in the motorBike tutorial), but how can I do a similar thing for a 2D case?



Attached Images
File Type: jpg tube2Dcase.jpg (22.0 KB, 26 views)
ncl94 is offline   Reply With Quote

Old   June 3, 2024, 07:46
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 695
Rep Power: 12
AtoHM is on a distinguished road
You take either the front or the back face and use this with the extrudeMesh utility with 1 layer to get a pseudo-2d-mesh which OpenFOAM requires. Google for a template extrudeMeshDict file to use.
ncl94 likes this.
AtoHM is offline   Reply With Quote

Old   June 4, 2024, 04:47
Default
  #3
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Thank you, @AtoHM ! I was able to find the extrudeMeshDict template. Unfortunately, OF documentation on extrudeMesh is almost nonexistent, making it hard to figure out what are the commands and what they do. I played around with the template but couldn't figure out a way to achieve what I want.


For instance, I have a blockMesh which creates a CV with a box shape defined by the following vertices for main diagonal: (0.25, 0.25, 0.25), (-0.75, -0.25, -0.25). My tube is positioned at (0,0,0) with its longitudinal axis colinear to x-axis. Do you know what commands could I use to get the extrude mesh to be defined by (0.25, 0.25, 0.005), (-0.75, -0.25, -0.005), which mean the thickness I am extruding is 0.01? The code I am using is the following:


extrudeModel linearNormal;

thickness 0.01; // used by plane extrusion

nLayers 1;
expansionRatio 1.0;

linearNormalCoeffs
{
thickness 0.01;
}

Last edited by ncl94; June 4, 2024 at 04:52. Reason: missed something
ncl94 is offline   Reply With Quote

Old   June 4, 2024, 06:17
Default
  #4
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Also, would you know what is the correct procedure? *Meaning the correct order of steps (e.g blockMesh -> snappyHexMesh -> extrudeMesh)
ncl94 is offline   Reply With Quote

Old   June 4, 2024, 11:03
Default
  #5
Senior Member
 
M
Join Date: Dec 2017
Posts: 695
Rep Power: 12
AtoHM is on a distinguished road
I don't really get that part.

Quote:
Originally Posted by ncl94 View Post
For instance, I have a blockMesh which creates a CV with a box shape defined by the following vertices for main diagonal: (0.25, 0.25, 0.25), (-0.75, -0.25, -0.25). My tube is positioned at (0,0,0) with its longitudinal axis colinear to x-axis. Do you know what commands could I use to get the extrude mesh to be defined by (0.25, 0.25, 0.005), (-0.75, -0.25, -0.005), which mean the thickness I am extruding is 0.01?
I have done this with blockMesh > snappyHexMesh > extrudeMesh. There are probably other ways to use it too, but this gave me maximum control of the mesh.
Going from your first post with the image, I assume you want to run this "face" as a 2d simulation. The visible surface is "FRONT" the one on the other side is "BACK", this extrudeMeshDict should give the correct result:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      extrudeProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
constructFrom patch;
sourceCase "$FOAM_CASE";
sourcePatches (FRONT);
exposedPatchName BACK;

flipNormals false;
 
extrudeModel        linearNormal;
 
nLayers             1;
expansionRatio      1.0;
 

linearNormalCoeffs
{
  thickness .01; //extrude 1 cm
}
 
mergeFaces false;
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ncl94 likes this.
AtoHM is offline   Reply With Quote

Old   June 4, 2024, 14:52
Default
  #6
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
I tried to be a bit formal I guess haha ... but what I meant is that if I do exactly as in the piece of code you posted in your last reply, I won't slice the middle of the mesh, where my tube is, but it will generate a mesh with 0.01 thickness from the FRONT boundary as in your example. I actually need something to do exactly the same thing but with an offset from the sourcePatch. Anyway, I appreciate the help.
ncl94 is offline   Reply With Quote

Reply


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
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 11:12
[mesh manipulation] Problems with rotational cyclic boundaries TReviol OpenFOAM Meshing & Mesh Conversion 8 July 11, 2014 03:45
[ICEM] Flow channel meshing problems StefanG ANSYS Meshing & Geometry 19 May 15, 2012 06:44
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 05:44
Help required to solve Hydraulic related problems aero CFX 0 October 30, 2006 11:00


All times are GMT -4. The time now is 23:45.