Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HPCAPPs
OpenFOAM-GPU-v2.0
Commits
55e5a777
Commit
55e5a777
authored
Oct 17, 2024
by
shunbo
Browse files
initial commit
parents
Changes
677
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1069 additions
and
0 deletions
+1069
-0
OpenFOAM-v2112/applications/test/cstring/Test-cstring.C
OpenFOAM-v2112/applications/test/cstring/Test-cstring.C
+154
-0
OpenFOAM-v2112/applications/test/cyclic/Make/files
OpenFOAM-v2112/applications/test/cyclic/Make/files
+3
-0
OpenFOAM-v2112/applications/test/cyclic/Make/options
OpenFOAM-v2112/applications/test/cyclic/Make/options
+7
-0
OpenFOAM-v2112/applications/test/cyclic/Test-cyclic.C
OpenFOAM-v2112/applications/test/cyclic/Test-cyclic.C
+66
-0
OpenFOAM-v2112/applications/test/cyclic/createFields.H
OpenFOAM-v2112/applications/test/cyclic/createFields.H
+27
-0
OpenFOAM-v2112/applications/test/decomposedBlockData/Make/files
...AM-v2112/applications/test/decomposedBlockData/Make/files
+3
-0
OpenFOAM-v2112/applications/test/decomposedBlockData/Make/options
...-v2112/applications/test/decomposedBlockData/Make/options
+2
-0
OpenFOAM-v2112/applications/test/decomposedBlockData/Test-decomposedBlockData.C
...tions/test/decomposedBlockData/Test-decomposedBlockData.C
+101
-0
OpenFOAM-v2112/applications/test/delete/Make/files
OpenFOAM-v2112/applications/test/delete/Make/files
+3
-0
OpenFOAM-v2112/applications/test/delete/Make/options
OpenFOAM-v2112/applications/test/delete/Make/options
+2
-0
OpenFOAM-v2112/applications/test/delete/Test-delete.C
OpenFOAM-v2112/applications/test/delete/Test-delete.C
+65
-0
OpenFOAM-v2112/applications/test/dictionary/Make/files
OpenFOAM-v2112/applications/test/dictionary/Make/files
+3
-0
OpenFOAM-v2112/applications/test/dictionary/Make/options
OpenFOAM-v2112/applications/test/dictionary/Make/options
+1
-0
OpenFOAM-v2112/applications/test/dictionary/Test-dictionary.C
...FOAM-v2112/applications/test/dictionary/Test-dictionary.C
+142
-0
OpenFOAM-v2112/applications/test/dictionary/blockMeshDict1.calc
...AM-v2112/applications/test/dictionary/blockMeshDict1.calc
+117
-0
OpenFOAM-v2112/applications/test/dictionary/blockMeshDict1.eval
...AM-v2112/applications/test/dictionary/blockMeshDict1.eval
+117
-0
OpenFOAM-v2112/applications/test/dictionary/testDict
OpenFOAM-v2112/applications/test/dictionary/testDict
+173
-0
OpenFOAM-v2112/applications/test/dictionary/testDict2
OpenFOAM-v2112/applications/test/dictionary/testDict2
+29
-0
OpenFOAM-v2112/applications/test/dictionary/testDictAPI
OpenFOAM-v2112/applications/test/dictionary/testDictAPI
+19
-0
OpenFOAM-v2112/applications/test/dictionary/testDictCalc1
OpenFOAM-v2112/applications/test/dictionary/testDictCalc1
+35
-0
No files found.
Too many changes to show.
To preserve performance only
677 of 677+
files are displayed.
Plain diff
Email patch
OpenFOAM-v2112/applications/test/cstring/Test-cstring.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test some string functionality
\*---------------------------------------------------------------------------*/
#include "CStringList.H"
#include "DynamicList.H"
#include "IOstreams.H"
#include "fileNameList.H"
#include "stringOps.H"
#include "stringList.H"
#include "wordList.H"
#include "SubStrings.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
print
(
int
argc
,
char
*
argv
[])
{
Info
<<
"argc="
<<
argc
<<
endl
;
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
Info
<<
" argv["
<<
i
<<
"] =
\"
"
<<
argv
[
i
]
<<
"
\"
"
<<
endl
;
}
return
argc
;
}
int
print
(
const
CStringList
&
cstrLst
)
{
return
print
(
cstrLst
.
size
(),
cstrLst
.
strings
());
}
// Using nullptr termination
int
print
(
char
*
argv
[])
{
if
(
!
argv
)
{
Info
<<
"argv=null"
<<
endl
;
return
0
;
}
int
i
=
0
;
while
(
argv
[
i
])
{
Info
<<
" argv["
<<
i
<<
"] =
\"
"
<<
argv
[
i
]
<<
"
\"
"
<<
endl
;
++
i
;
}
return
i
;
}
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
DynamicList
<
string
>
dynlst
;
dynlst
.
reserve
(
16
);
dynlst
.
append
(
"string1 with content"
);
dynlst
.
append
(
"string2 other content"
);
dynlst
.
append
(
"string3 more"
);
dynlst
.
append
(
"string4 done"
);
{
CStringList
inC
(
dynlst
);
Info
<<
"input: "
<<
dynlst
<<
nl
;
print
(
inC
);
Info
<<
"null-terminated string list"
<<
nl
;
print
(
inC
.
strings
());
Info
<<
"sublist: starting at "
<<
inC
.
size
()
/
2
<<
nl
;
print
(
inC
.
strings
(
inC
.
size
()
/
2
));
Info
<<
nl
;
}
{
string
testInput
(
" A test input line with various spacing "
" and text to be split on whitespace "
);
Info
<<
testInput
<<
nl
;
SubStrings
<
string
>
args
=
stringOps
::
splitSpace
(
testInput
);
Info
<<
"split into "
<<
args
.
size
()
<<
" args"
<<
nl
;
CStringList
inC
(
args
);
print
(
inC
);
Info
<<
"sublist: starting at "
<<
inC
.
size
()
/
2
<<
nl
;
print
(
inC
.
strings
(
inC
.
size
()
/
2
));
Info
<<
nl
;
}
Info
<<
"command-line with "
<<
CStringList
::
count
(
argv
)
<<
" items"
<<
endl
;
print
(
argc
,
argv
);
Info
<<
nl
;
{
dynlst
.
clear
();
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
dynlst
.
append
(
argv
[
i
]);
}
Info
<<
"input: "
<<
dynlst
<<
endl
;
CStringList
inC
(
dynlst
);
inC
.
reset
(
dynlst
);
print
(
inC
);
Info
<<
"length: "
<<
inC
.
length
()
<<
endl
;
std
::
cout
.
write
(
inC
.
data
(),
inC
.
length
());
}
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cyclic/Make/files
0 → 100644
View file @
55e5a777
Test-cyclic.C
EXE = $(FOAM_USER_APPBIN)/Test-cyclic
OpenFOAM-v2112/applications/test/cyclic/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
OpenFOAM-v2112/applications/test/cyclic/Test-cyclic.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
icofoam
Description
Incompressible CFD code
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
Info
<<
polyPatch
::
constraintTypes
()
<<
endl
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
nl
<<
"Starting tests"
<<
endl
;
Info
<<
mesh
.
V
()
<<
endl
;
Info
<<
mesh
.
Sf
()
<<
endl
;
Info
<<
mesh
.
owner
()
<<
endl
;
Info
<<
mesh
.
neighbour
()
<<
endl
;
Info
<<
fvc
::
div
(
U
);
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cyclic/createFields.H
0 → 100644
View file @
55e5a777
Info
<<
nl
<<
"Reading field p"
<<
endl
;
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
nl
<<
"Reading field U"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
OpenFOAM-v2112/applications/test/decomposedBlockData/Make/files
0 → 100644
View file @
55e5a777
Test-decomposedBlockData.C
EXE = $(FOAM_USER_APPBIN)/Test-decomposedBlockData
OpenFOAM-v2112/applications/test/decomposedBlockData/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/decomposedBlockData/Test-decomposedBlockData.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-decomposedBlockData
Description
Convert decomposedBlockData into its components.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "decomposedBlockData.H"
#include "OFstream.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addArgument
(
"file"
);
#include "setRootCase.H"
if
(
!
Pstream
::
parRun
())
{
FatalErrorInFunction
<<
"Run in parallel"
<<
exit
(
FatalError
);
}
#include "createTime.H"
const
auto
file
=
args
.
get
<
fileName
>
(
1
);
Info
<<
"Reading "
<<
file
<<
nl
<<
endl
;
decomposedBlockData
data
(
Pstream
::
worldComm
,
IOobject
(
file
,
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
data
.
rename
(
data
.
name
()
+
"Data"
);
fileName
objPath
(
data
.
objectPath
());
mkDir
(
objPath
.
path
());
Info
<<
"Opening output file "
<<
objPath
<<
nl
<<
endl
;
OFstream
os
(
objPath
,
IOstream
::
BINARY
,
IOstream
::
currentVersion
,
runTime
.
writeCompression
()
);
if
(
!
os
.
good
())
{
FatalErrorInFunction
<<
"Failed opening "
<<
objPath
<<
exit
(
FatalError
);
}
if
(
!
data
.
writeData
(
os
))
{
FatalErrorInFunction
<<
"Failed writing "
<<
objPath
<<
exit
(
FatalError
);
}
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/delete/Make/files
0 → 100644
View file @
55e5a777
Test-delete.C
EXE = $(FOAM_USER_APPBIN)/Test-delete
OpenFOAM-v2112/applications/test/delete/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/delete/Test-delete.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Description
\*---------------------------------------------------------------------------*/
#include "string.H"
#include "IOstreams.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
()
{
string
a
(
"a"
),
b
(
"b"
),
c
(
"c"
),
d
(
"d"
),
e
(
"e"
),
f
(
"f"
),
g
(
"g"
),
h
(
"h"
),
i
(
"i"
),
j
(
"j"
);
Info
<<
"1) a = b + c + d + e + f + g;
\n
"
;
a
=
b
+
c
+
d
+
e
+
f
+
g
;
Info
<<
a
<<
endl
;
{
Info
<<
"2) a = e + f + g;
\n
"
;
a
=
e
+
f
+
g
;
Info
<<
a
<<
endl
;
}
Info
<<
"3) a = h + i + j;
\n
"
;
a
=
h
+
i
+
j
;
Info
<<
a
<<
endl
;
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/dictionary/Make/files
0 → 100644
View file @
55e5a777
Test-dictionary.C
EXE = $(FOAM_USER_APPBIN)/Test-dictionary
OpenFOAM-v2112/applications/test/dictionary/Make/options
0 → 100644
View file @
55e5a777
EXE_INC =
OpenFOAM-v2112/applications/test/dictionary/Test-dictionary.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
dictionaryTest
Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "IOstreams.H"
#include "IOobject.H"
#include "IFstream.H"
#include "dictionary.H"
#include "stringOps.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noParallel
();
argList
::
addArgument
(
"dict .. dictN"
);
argList
args
(
argc
,
argv
,
false
,
true
);
{
dictionary
dict
;
dict
.
add
(
word
(
"ab"
+
getEnv
(
"WM_MPLIB"
)
+
"cd"
),
16
);
string
s
(
"DDD_${ab${WM_MPLIB}cd}_EEE"
);
stringOps
::
inplaceExpand
(
s
,
dict
,
true
,
false
);
Info
<<
"variable expansion:"
<<
s
<<
endl
;
}
Info
<<
nl
<<
"FOAM_CASE="
<<
getEnv
(
"FOAM_CASE"
)
<<
nl
<<
"FOAM_CASENAME="
<<
getEnv
(
"FOAM_CASENAME"
)
<<
nl
<<
endl
;
if
(
args
.
size
()
<=
1
)
{
{
dictionary
dict1
(
IFstream
(
"testDict"
)());
dict1
.
writeEntry
(
"dict1"
,
Info
);
Info
<<
nl
<<
"toc: "
<<
dict1
.
toc
()
<<
nl
<<
"keys: "
<<
dict1
.
keys
()
<<
nl
<<
"patterns: "
<<
dict1
.
keys
(
true
)
<<
endl
;
dictionary
dict2
(
std
::
move
(
dict1
));
Info
<<
"dict1.toc(): "
<<
dict1
.
name
()
<<
" "
<<
dict1
.
toc
()
<<
nl
<<
"dict2.toc(): "
<<
dict2
.
name
()
<<
" "
<<
dict2
.
toc
()
<<
endl
;
// copy back
dict1
=
dict2
;
Info
<<
"dict1.toc(): "
<<
dict1
.
name
()
<<
" "
<<
dict1
.
toc
()
<<
endl
;
dictionary
dict3
(
dict2
.
findDict
(
"boundaryField"
));
dictionary
dict4
(
dict2
.
findDict
(
"NONEXISTENT"
));
Info
<<
"dictionary construct from pointer"
<<
nl
<<
"ok = "
<<
dict3
.
name
()
<<
" "
<<
dict3
.
toc
()
<<
nl
<<
"no = "
<<
dict4
.
name
()
<<
" "
<<
dict4
.
toc
()
<<
endl
;
}
IOobject
::
writeDivider
(
Info
);
{
dictionary
dict
(
IFstream
(
"testDictRegex"
)());
dict
.
add
(
keyType
(
"fooba[rz]"
,
keyType
::
REGEX
),
"anything"
);
dict
.
writeEntry
(
"testDictRegex"
,
Info
);
Info
<<
nl
<<
"toc: "
<<
dict
.
toc
()
<<
nl
<<
"keys: "
<<
dict
.
keys
()
<<
nl
<<
"patterns: "
<<
dict
.
keys
(
true
)
<<
endl
;
Info
<<
"Pattern find
\"
abc
\"
in top directory : "
<<
dict
.
lookup
(
"abc"
)
<<
endl
;
Info
<<
"Pattern find
\"
abc
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"abc"
)
<<
nl
;
Info
<<
"Recursive pattern find
\"
def
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"def"
,
true
)
<<
nl
;
Info
<<
"Recursive pattern find
\"
foo
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"foo"
,
true
)
<<
nl
;
Info
<<
"Recursive pattern find
\"
fooz
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"fooz"
,
true
)
<<
nl
;
Info
<<
"Recursive pattern find
\"
bar
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"bar"
,
true
)
<<
nl
;
Info
<<
"Recursive pattern find
\"
xxx
\"
in sub directory : "
<<
dict
.
subDict
(
"someDict"
).
lookup
(
"xxx"
,
true
)
<<
nl
;
}
}
else
{
IOobject
::
writeDivider
(
Info
);
for
(
label
argi
=
1
;
argi
<
args
.
size
();
++
argi
)
{
const
auto
dictFile
=
args
.
get
<
fileName
>
(
argi
);
IFstream
is
(
dictFile
);
dictionary
dict
(
is
);
Info
<<
dict
<<
endl
;
}
}
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/dictionary/blockMeshDict1.calc
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
scale 1;
//- Half angle of wedge in degrees
halfAngle 45.0;
//- Radius of pipe [m]
radius 0.5;
y #calc #{ $radius*sin(degToRad($halfAngle)) #};
minY #calc #{ -1.0*$y #};
z #calc #{ $radius*cos(degToRad($halfAngle)) #};
minZ #calc #{ -1.0*$z #};
vertices
(
(0.0 0.0 0) //0
(10 0.0 0)
#calc #{ vector(10, 0, 0) #} //2
(0.0 0.0 0)
(0.0 $minY $z) //4
(10 $minY $z)
(10 $y $z) //6
(0.0 $y $z)
);
blocks
(
// inlet block
hex (0 1 2 3 4 5 6 7) (50 5 5) simpleGrading (1 1 1)
);
edges
(
arc 4 7 (0 0 $radius)
arc 5 6 (10 0 $radius)
);
boundary
(
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(1 2 6 5)
);
}
side1
{
type cyclicAMI;
neighbourPatch side2;
faces
(
(0 1 5 4)
);
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
side2
{
type cyclicAMI;
neighbourPatch side1;
faces
(
(7 6 2 3)
);
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
walls
{
type wall;
faces
(
(4 5 6 7)
(3 2 1 0)
);
}
);
// ************************************************************************* //
OpenFOAM-v2112/applications/test/dictionary/blockMeshDict1.eval
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
scale 1;
//- Half angle of wedge in degrees
halfAngle 45.0;
//- Radius of pipe [m]
radius 0.5;
y #eval{ $radius*sin(degToRad($halfAngle)) };
minY #eval{ -1*$y };
z #eval{ $radius*cos(degToRad($halfAngle)) };
minZ #eval{ -1*$z };
vertices
(
(0.0 0.0 0) //0
(10 0.0 0)
#eval{ vector(10, 0, 0) } //2
(0.0 0.0 0)
(0.0 $minY $z) //4
(10 $minY $z)
(10 $y $z) //6
(0.0 $y $z)
);
blocks
(
// inlet block
hex (0 1 2 3 4 5 6 7) (50 5 5) simpleGrading (1 1 1)
);
edges
(
arc 4 7 (0 0 $radius)
arc 5 6 (10 0 $radius)
);
boundary
(
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(1 2 6 5)
);
}
side1
{
type cyclicAMI;
neighbourPatch side2;
faces
(
(0 1 5 4)
);
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
side2
{
type cyclicAMI;
neighbourPatch side1;
faces
(
(7 6 2 3)
);
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
walls
{
type wall;
faces
(
(4 5 6 7)
(3 2 1 0)
);
}
);
// ************************************************************************* //
OpenFOAM-v2112/applications/test/dictionary/testDict
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dictionary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#sinclude "someUnknownFile"
#sinclude "$FOAM_CASE/someUnknownFile"
#includeIfPresent "$FOAM_CASE/someUnknownFile-$FOAM_CASENAME"
zeroVelocity uniform (0 0 0);
internalField uniform 1;
// supply defaults
#default internalField uniform 10;
#default dimensions [ 1 2 -2 0 0 0 0 ];
#overwrite dimensions [ 0 2 -2 0 0 0 0 ];
// #warn dimensions [ 0 2 -2 0 0 0 0 ];
// #error dimensions [ 0 2 -2 0 0 0 0 ];
active
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.1;
value $internalField;
}
inactive
{
type zeroGradient;
}
// Indirection
varType active;
// Indirection of values
x 5;
varName x;
// Indirection for keys
key inlet_9;
boundaryField
{
Default_Boundary_Region
{
type zeroGradient;
}
inlet_1 { $active }
inlet_2 { $inactive }
inlet_3 { $inactive }
inlet_4 { $inactive }
inlet_5 "a primitiveEntry is squashed by a directory entry";
inlet_5 { $inactive }
inlet_6a { $...inactive } // Relative scoping - fairly horrible to use
inlet_6b { $^inactive } // Absolute scoping
inlet_6c { key ${/key}; } // Absolute scoping
inlet_7 { ${inactive}} // Test variable expansion
inlet_8 { $inactive }
// Variable expansion for a keyword
${key} { $inactive }
#include "testDictInc"
outletBase
{
type inletOutlet;
inletValue $internalField;
value #include "value";
// error #remove self;
x ${${varName}}; // Test indirection/recursive expansion
y 6;
}
outlet
{
$outletBase
}
Default_Boundary_Region
{
valueOut $zeroVelocity;
}
// this should have no effect (not in scope)
#remove inactive
// But this should work to remove things in different scopes
#remove "/zeroVelocity"
inlet_7 { ${inactive} } // Test variable expansion
inlet_8 { $inactive }
inlet_7a { ${${varType}} } // Test indirection/recursive expansion
inlet_7b { ${${varType}} } // Test indirection/recursive expansion
#overwrite inlet_8 { type none; }
}
// No patterns with scoped removal
// #remove "/boundaryField/outletB.*"
#remove "/boundaryField/outletBase"
#include "testDict2"
verbatim #{
This is a somewhat larger chunk of verbatim text that we would much
prefer to move as a token rather than copying its entire content each
time we do parsing or need to resize the token list.
#};
foo
{
$active
}
bar
{
$active
}
baz
{
$active
}
"anynumber.*"
{
$active
}
// This should work
#remove x
// This should work too
#remove ( bar baz )
// Remove a sub-dictionary entry
#remove "/anynumber.*/value"
// Removal does not auto-vivify
#remove "/nonExistentDict/value"
// Add into existing dictionary
"/anynumber.*/someValue" 100;
// Auto-vivify
// - but currently cannot auto-vivify entries with dictionary patterns
"/abd/someValue" 100;
"/def/'someValue.*" 100;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/dictionary/testDict2
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dictionary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
boundaryField
{
Default_Boundary_Region
{
value $internalField;
note "actually a noslip wall";
}
inlet_3 "a primitiveEntry squashes directory entry";
}
#inputMode overwrite
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/dictionary/testDictAPI
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dictionary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
_FOAM_API $FOAM_API;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/dictionary/testDictCalc1
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dictionary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
calc1 #calc #{ degToRad() *
constant::mathematical::pi *
cos(100.0) * mag(19) + 1 * constant::mathematical::pi
+
// Skip comments
constant::mathematical::pi * 15 + hypot(3.0,4.0) #};
calc3 (#calc"hypot(3.0,4.0)", #calc"sqrt(2.0)", #calc"constant::mathematical::pi");
calc4 #calc"$calc1 * 10";
pi() #calc #{ constant::mathematical::pi #};
sinh(0.1) #calc #{ sinh(0.1) #};
cosh(0.1) #calc #{ cosh(0.1) #};
sqrt100 #calc #{((sqrt(100.0)))#};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Prev
1
…
19
20
21
22
23
24
25
26
27
…
34
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment