Fixed sws_ola
This commit is contained in:
parent
ba675fb763
commit
a335f2f5ce
19 changed files with 311413 additions and 33 deletions
|
@ -2,10 +2,9 @@
|
||||||
np_out=../swash/inp_post
|
np_out=../swash/inp_post
|
||||||
|
|
||||||
[bathy]
|
[bathy]
|
||||||
bathy=../swash/data/bathyhires.dat
|
bathy=../data/out_of/bathy.dat
|
||||||
hstru=../swash/data/Hstru.dat
|
hstru=../data/out_of/hstru.dat
|
||||||
scale=[0.5,1,1]
|
scale=[0.5,1,1]
|
||||||
translate=[-149,0,0]
|
|
||||||
out=out_bathy
|
out=out_bathy
|
||||||
|
|
||||||
[olaflow]
|
[olaflow]
|
||||||
|
|
53
olaflow/of/constant/polyMesh/boundary
Normal file
53
olaflow/of/constant/polyMesh/boundary
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
5
|
||||||
|
(
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 77;
|
||||||
|
startFace 38318;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 34;
|
||||||
|
startFace 38395;
|
||||||
|
}
|
||||||
|
atmosphere
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 300;
|
||||||
|
startFace 38429;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
inGroups List<word> 1(empty);
|
||||||
|
nFaces 38698;
|
||||||
|
startFace 38729;
|
||||||
|
}
|
||||||
|
bathy
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
inGroups List<word> 1(wall);
|
||||||
|
nFaces 349;
|
||||||
|
startFace 77427;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
19
olaflow/of/constant/polyMesh/cellLevel
Normal file
19
olaflow/of/constant/polyMesh/cellLevel
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class labelList;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object cellLevel;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
19349{0}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
20
olaflow/of/constant/polyMesh/cellZones
Normal file
20
olaflow/of/constant/polyMesh/cellZones
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class regIOobject;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object cellZones;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
0
|
||||||
|
()
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
20
olaflow/of/constant/polyMesh/faceZones
Normal file
20
olaflow/of/constant/polyMesh/faceZones
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class regIOobject;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object faceZones;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
0
|
||||||
|
()
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
77799
olaflow/of/constant/polyMesh/faces
Normal file
77799
olaflow/of/constant/polyMesh/faces
Normal file
File diff suppressed because it is too large
Load diff
22
olaflow/of/constant/polyMesh/level0Edge
Normal file
22
olaflow/of/constant/polyMesh/level0Edge
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class uniformDimensionedScalarField;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object level0Edge;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 0 0 0 0 0];
|
||||||
|
value 0.5;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
38342
olaflow/of/constant/polyMesh/neighbour
Normal file
38342
olaflow/of/constant/polyMesh/neighbour
Normal file
File diff suppressed because it is too large
Load diff
77800
olaflow/of/constant/polyMesh/owner
Normal file
77800
olaflow/of/constant/polyMesh/owner
Normal file
File diff suppressed because it is too large
Load diff
19
olaflow/of/constant/polyMesh/pointLevel
Normal file
19
olaflow/of/constant/polyMesh/pointLevel
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class labelList;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object pointLevel;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
39460{0}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
20
olaflow/of/constant/polyMesh/pointZones
Normal file
20
olaflow/of/constant/polyMesh/pointZones
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: 9
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class regIOobject;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object pointZones;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
0
|
||||||
|
()
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
39483
olaflow/of/constant/polyMesh/points
Normal file
39483
olaflow/of/constant/polyMesh/points
Normal file
File diff suppressed because it is too large
Load diff
77799
olaflow/of/constant/polyMesh/surfaceIndex
Normal file
77799
olaflow/of/constant/polyMesh/surfaceIndex
Normal file
File diff suppressed because it is too large
Load diff
1
olaflow/of/constant/triSurface
Symbolic link
1
olaflow/of/constant/triSurface
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../out_bathy/
|
|
@ -19,14 +19,14 @@ scale 1;
|
||||||
|
|
||||||
vertices
|
vertices
|
||||||
(
|
(
|
||||||
|
(-150 0 -30)
|
||||||
(0 0 -30)
|
(0 0 -30)
|
||||||
(150 0 -30)
|
(0 0 30)
|
||||||
(150 0 20)
|
(-150 0 30)
|
||||||
(0 0 20)
|
(-150 1 -30)
|
||||||
(0 1 -30)
|
(0 1 -30)
|
||||||
(150 1 -30)
|
(0 1 30)
|
||||||
(150 1 20)
|
(-150 1 30)
|
||||||
(0 1 20)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
blocks
|
blocks
|
||||||
|
|
|
@ -25,7 +25,7 @@ regions
|
||||||
(
|
(
|
||||||
boxToCell
|
boxToCell
|
||||||
{
|
{
|
||||||
box (-10 -10 -100) (500 10 5);
|
box (-200 -100 -100) (100 100 4.5);
|
||||||
|
|
||||||
fieldValues
|
fieldValues
|
||||||
(
|
(
|
||||||
|
@ -34,8 +34,8 @@ regions
|
||||||
}
|
}
|
||||||
surfaceToCell
|
surfaceToCell
|
||||||
{
|
{
|
||||||
file "./constant/triSurface/rubble.stl";
|
file "./constant/triSurface/poro.stl";
|
||||||
outsidePoints ((0 0 0)); // definition of outside
|
outsidePoints ((-100 0 0)); // definition of outside
|
||||||
includeCut true; // cells cut by surface
|
includeCut true; // cells cut by surface
|
||||||
includeInside true; // cells not on outside of surf
|
includeInside true; // cells not on outside of surf
|
||||||
includeOutside false; // cells on outside of surf
|
includeOutside false; // cells on outside of surf
|
||||||
|
|
|
@ -29,16 +29,6 @@ addLayers false;
|
||||||
geometry
|
geometry
|
||||||
{
|
{
|
||||||
|
|
||||||
bloc0.stl
|
|
||||||
{
|
|
||||||
type triSurfaceMesh;
|
|
||||||
name bloc0;
|
|
||||||
}
|
|
||||||
bloc1.stl
|
|
||||||
{
|
|
||||||
type triSurfaceMesh;
|
|
||||||
name bloc1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bathy.stl
|
bathy.stl
|
||||||
{
|
{
|
||||||
|
@ -125,14 +115,6 @@ castellatedMeshControls
|
||||||
{
|
{
|
||||||
level ( 0 0 );
|
level ( 0 0 );
|
||||||
}
|
}
|
||||||
bloc0
|
|
||||||
{
|
|
||||||
level ( 0 0 );
|
|
||||||
}
|
|
||||||
bloc1
|
|
||||||
{
|
|
||||||
level ( 0 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +154,7 @@ castellatedMeshControls
|
||||||
// section reachable from the locationInMesh is kept.
|
// section reachable from the locationInMesh is kept.
|
||||||
// NOTE: This point should never be on a face, always inside a cell, even
|
// NOTE: This point should never be on a face, always inside a cell, even
|
||||||
// after refinement.
|
// after refinement.
|
||||||
locationInMesh (0.25 0.01 0.25);
|
locationInMesh (-100 0 0);
|
||||||
|
|
||||||
// Whether any faceZones (as specified in the refinementSurfaces)
|
// Whether any faceZones (as specified in the refinementSurfaces)
|
||||||
// are only on the boundary of corresponding cellZones or also allow
|
// are only on the boundary of corresponding cellZones or also allow
|
||||||
|
|
|
@ -20,8 +20,9 @@ log.info("Starting sws -> olaFlow converter")
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read("config.ini")
|
config.read("config.ini")
|
||||||
|
|
||||||
bathy = np.loadtxt(config.get("bathy", "bathy"))
|
bathy = np.loadtxt(config.get("bathy", "bathy"))[::-1]
|
||||||
poro = bathy + np.loadtxt(config.get("bathy", "hstru"))
|
hstru = np.loadtxt(config.get("bathy", "hstru"))[::-1]
|
||||||
|
poro = bathy + np.where(hstru == 0, -5, hstru)
|
||||||
|
|
||||||
out = pathlib.Path(config.get("bathy", "out"))
|
out = pathlib.Path(config.get("bathy", "out"))
|
||||||
out.mkdir(exist_ok=True)
|
out.mkdir(exist_ok=True)
|
||||||
|
|
|
@ -12,6 +12,7 @@ def stl_from_1d(data, output, scale=[1, 1, 1], translate=[0, 0, 0]):
|
||||||
np.savetxt(tmpdir.joinpath("data.dat"), np.stack((data, data)))
|
np.savetxt(tmpdir.joinpath("data.dat"), np.stack((data, data)))
|
||||||
with open(tmpdir.joinpath("scad"), "wt") as scad:
|
with open(tmpdir.joinpath("scad"), "wt") as scad:
|
||||||
scad.write(
|
scad.write(
|
||||||
|
f"mirror([1, 0, 0])"
|
||||||
f"translate({translate})"
|
f"translate({translate})"
|
||||||
f"scale({scale})"
|
f"scale({scale})"
|
||||||
f"""surface("data.dat");"""
|
f"""surface("data.dat");"""
|
||||||
|
|
Loading…
Reference in a new issue