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

[mesh manipulation] Iterate refineMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 13, 2015, 06:07
Default Iterate refineMesh
  #1
sgr
New Member
 
Simon Grützner
Join Date: Apr 2015
Posts: 7
Rep Power: 11
sgr is on a distinguished road
Dear FOAMers,

this is my first thread and I am quite new to this library. First of all, i'd like to thank you all for a great forum. It helped me so much this far and will probably continue to do so for a long time.

I encountered the following problem. I have a fairly simple block like geometry (cf. the attached images) and want to use refineMesh in two sequential steps.



The first step intends to refine half the domain and the second just a part of that just refined region.

I used the following commands in an Allrun bash script to execute the refineMesh command sequentially:
Code:
runApplication blockMesh 
runApplication topoSet -dict sytstem/refine.topoSetDict.1
runApplicattion refineMesh -overwrite -dict system/refineMeshDict.1
rm log.topoSet

runApplication topoSet -dict sytstem/refine.topoSetDict.2
runApplication refineMesh -overwrite -dict system/refineMeshDict.2
rm log.topoSet
refine.topoSetDict.{1,2} define the cellSets refineCells1 and refineCells2, respectively. The refineMeshDict then looks like this:

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      refineMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Cells to refine; name of cell set
set refineCells1;

// Type of coordinate system:
// - global : coordinate system same for every cell. Usually aligned with
//   x,y,z axis. Specify in globalCoeffs section below.
// - patchLocal : coordinate system different for every cell. Specify in
//   patchLocalCoeffs section below.
//coordinateSystem global;
coordinateSystem global;


// .. and its coefficients. x,y in this case. (normal direction is calculated
// as tan1^tan2)
globalCoeffs
{
    tan1 (0 0 1);
    tan2 (1 0 0);
}

patchLocalCoeffs
{
    patch patchName; //Normal direction is facenormal of zero'th face of patch
    tan1 (0 0 1);
    tan2 (1 0 0);
}

// List of directions to refine
directions
(
    tan1
    tan2
    //    normal
);

// Whether to use hex topology. This will
// - if patchLocal: all cells on selected patch should be hex
// - split all hexes in 2x2x2 through the middle of edges.
useHexTopology  true;

// Cut purely geometric (will cut hexes through vertices) or take topology
// into account. Incompatible with useHexTopology
geometricCut    false;

// Write meshes from intermediate steps
writeMesh        false;

// ************************************************************************* //
where the sets at the top are named refineCells1 and refineCells2, respectively.

When I run the script, only the first cellSet is refined and the second one not. I also looked at both pages of the thread

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

but did not succeed in applying it to my case. Can anyone explain to me, what i am doing wrong here?

Best regards,
Simon
Attached Images
File Type: jpg 1stStep.jpg (20.2 KB, 137 views)
File Type: jpg 2ndStep.jpg (21.2 KB, 113 views)

Last edited by sgr; May 13, 2015 at 06:47. Reason: uploaded an older version of my refineMeshDict
sgr is offline   Reply With Quote

Old   May 13, 2015, 06:49
Default
  #2
sgr
New Member
 
Simon Grützner
Join Date: Apr 2015
Posts: 7
Rep Power: 11
sgr is on a distinguished road
Hi FOAMers,

the problem was, that i did not delete the log.refineMesh file. Adding

Code:
rm log.refineMesh
to the Allrun script solves the problem and the Case now runs like a charm. :-)
sgr is offline   Reply With Quote

Reply

Tags
mesh, refinemesh, toposet


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
[mesh manipulation] multiple calls to refineMesh parallel w/ dict failing Regis_ OpenFOAM Meshing & Mesh Conversion 2 June 4, 2015 14:44
[mesh manipulation] checkMesh Erros after refineMesh mgdenno OpenFOAM Meshing & Mesh Conversion 10 October 14, 2014 06:16
[mesh manipulation] Cannot get refineMesh to run in parallel smschnob OpenFOAM Meshing & Mesh Conversion 2 June 3, 2014 12:20
[mesh manipulation] refineMesh inverses face normals? RoE OpenFOAM Meshing & Mesh Conversion 3 August 3, 2012 12:41
checkMesh Errors after refineMesh mgdenno OpenFOAM 0 July 30, 2012 22:39


All times are GMT -4. The time now is 15:53.