Dambreak with mesh refinement / unrefinement update.

This commit is contained in:
mattijs
2008-05-15 11:24:33 +01:00
parent 36e61940a7
commit b6c519717c
10 changed files with 597 additions and 50 deletions

View File

@ -742,16 +742,21 @@ labelList dynamicRefineFvMesh::selectRefineCells
} }
} }
Info<< "Selected " << returnReduce(candidates.size(), sumOp<label>()) // Guarantee 2:1 refinement after refinement
labelList consistentSet
(
meshCutter_.consistentRefinement
(
candidates.shrink(),
true // Add to set to guarantee 2:1
)
);
Info<< "Selected " << returnReduce(consistentSet.size(), sumOp<label>())
<< " cells for refinement out of " << globalData().nTotalCells() << " cells for refinement out of " << globalData().nTotalCells()
<< "." << endl; << "." << endl;
// Guarantee 2:1 refinement across processor patches. return consistentSet;
return meshCutter_.consistentRefinement
(
candidates.shrink(),
true // Add to set to guarantee 2:1
);
} }
@ -795,18 +800,23 @@ labelList dynamicRefineFvMesh::selectUnrefinePoints
} }
Info<< "Selected " << returnReduce(newSplitPoints.size(), sumOp<label>()) newSplitPoints.shrink();
// Guarantee 2:1 refinement after unrefinement
labelList consistentSet
(
meshCutter_.consistentUnrefinement
(
newSplitPoints,
false
)
);
Info<< "Selected " << returnReduce(consistentSet.size(), sumOp<label>())
<< " split points out of a possible " << " split points out of a possible "
<< returnReduce(splitPoints.size(), sumOp<label>()) << returnReduce(splitPoints.size(), sumOp<label>())
<< "." << endl; << "." << endl;
newSplitPoints.shrink(); return consistentSet;
return meshCutter_.consistentUnrefinement
(
newSplitPoints,
false
);
} }

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 | | \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 | | \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -18,7 +18,7 @@ FoamFile
dimensions [0 0 0 0 0 0 0]; dimensions [0 0 0 0 0 0 0];
internalField nonuniform List<scalar> internalField nonuniform List<scalar>
32256 32768
( (
1 1
1 1
@ -980,6 +980,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -1940,6 +2004,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -2900,6 +3028,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -3860,6 +4052,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -4820,6 +5076,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -5780,6 +6100,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -6740,6 +7124,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1
@ -7700,6 +8148,70 @@ internalField nonuniform List<scalar>
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
1 1

View File

@ -1,36 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 | | \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField;
object gamma.org; root "";
location "0.001"; case "";
instance "";
local "";
class volScalarField;
object gamma;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0]; dimensions [0 0 0 0 0 0 0];
internalField uniform 0; internalField uniform 0;
boundaryField boundaryField
{ {
atmosphere walls
{
type zeroGradient;
}
obstacle
{
type zeroGradient;
}
atmosphere
{ {
type inletOutlet; type inletOutlet;
inletValue uniform 0; inletValue uniform 0;
value uniform 0; value uniform 0;
} }
walls
{
type zeroGradient;
}
} }

View File

@ -1,41 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*---------------------------------------------------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 | | \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField;
object pd; root "";
location "0.001"; case "";
instance "";
local "";
class volScalarField;
object pd;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0]; dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0; internalField uniform 0;
boundaryField boundaryField
{ {
atmosphere walls
{
type zeroGradient;
}
obstacle
{
type zeroGradient;
}
atmosphere
{ {
type totalPressure; type totalPressure;
p0 uniform 0;
U U; U U;
phi phi; phi phi;
rho none; rho none;
psi none; psi none;
gamma 1; gamma 1;
p0 uniform 0;
value uniform 0; value uniform 0;
} }
walls
{
type zeroGradient;
}
} }

View File

@ -1 +0,0 @@
# Time (0.51 0.51 0.51)

View File

@ -1 +0,0 @@
# Time (0.51 0.51 0.51)

View File

@ -1 +0,0 @@
# Time (0.51 0.51 0.51)

View File

@ -54,7 +54,7 @@ runTimeModifiable yes;
adjustTimeStep yes; adjustTimeStep yes;
maxCo 0.5; maxCo 0.1;
maxDeltaT 1; maxDeltaT 1;

View File

@ -23,10 +23,10 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4; numberOfSubdomains 6;
//method metis; method metis;
method hierarchical; //method hierarchical;
simpleCoeffs simpleCoeffs
{ {