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

Iterate refineMesh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 13, 2015, 05:07
Default Iterate refineMesh
  #1
sgr
New Member
 
Simon Grützner
Join Date: Apr 2015
Posts: 7
Rep Power: 3
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

BlockMesh cellSet refineMesh

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, 44 views)
File Type: jpg 2ndStep.jpg (21.2 KB, 40 views)

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

Old   May 13, 2015, 05:49
Default
  #2
sgr
New Member
 
Simon Grützner
Join Date: Apr 2015
Posts: 7
Rep Power: 3
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

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
multiple calls to refineMesh parallel w/ dict failing Regis_ OpenFOAM Mesh Utilities 2 June 4, 2015 13:44
checkMesh Erros after refineMesh mgdenno OpenFOAM Mesh Utilities 10 October 14, 2014 05:16
Cannot get refineMesh to run in parallel smschnob OpenFOAM Meshing & Mesh Conversion 2 June 3, 2014 11:20
checkMesh Errors after refineMesh mgdenno OpenFOAM 0 July 30, 2012 21:39
Cannot refineMesh with useHexTopology true ver141 naoki OpenFOAM Bugs 5 June 11, 2008 04:07


All times are GMT -4. The time now is 18:46.