Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f7f6faa8
Commit
f7f6faa8
authored
Apr 22, 2010
by
Mark Olesen
Browse files
Merge remote branch 'OpenCFD/master' into olesenm
parents
b16ef5f0
526aefad
Changes
36
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
View file @
f7f6faa8
...
...
@@ -577,21 +577,56 @@ Foam::polyMesh::polyMesh
<<
"Found "
<<
nFaces
-
defaultPatchStart
<<
" undefined faces in mesh; adding to default patch."
<<
endl
;
boundary_
.
set
(
nAllPatches
,
polyPatch
::
New
// Check if there already exists a defaultFaces patch as last patch
// and reuse it.
label
patchI
=
findIndex
(
boundaryPatchNames
,
defaultBoundaryPatchName
);
if
(
patchI
!=
-
1
)
{
if
(
patchI
!=
boundaryFaces
.
size
()
-
1
||
boundary_
[
patchI
].
size
())
{
FatalErrorIn
(
"polyMesh::polyMesh(... construct from shapes...)"
)
<<
"Default patch "
<<
boundary_
[
patchI
].
name
()
<<
" already has faces in it or is not"
<<
" last in list of patches."
<<
exit
(
FatalError
);
}
WarningIn
(
"polyMesh::polyMesh(... construct from shapes...)"
)
<<
"Reusing existing patch "
<<
patchI
<<
" for undefined faces."
<<
endl
;
boundary_
.
set
(
defaultBoundaryPatchType
,
defaultBoundaryPatchName
,
nFaces
-
defaultPatchStart
,
defaultPatchStart
,
boundary_
.
size
()
-
1
,
boundary_
)
);
patchI
,
polyPatch
::
New
(
boundaryPatchTypes
[
patchI
],
boundaryPatchNames
[
patchI
],
nFaces
-
defaultPatchStart
,
defaultPatchStart
,
patchI
,
boundary_
)
);
}
else
{
boundary_
.
set
(
nAllPatches
,
polyPatch
::
New
(
defaultBoundaryPatchType
,
defaultBoundaryPatchName
,
nFaces
-
defaultPatchStart
,
defaultPatchStart
,
boundary_
.
size
()
-
1
,
boundary_
)
);
nAllPatches
++
;
nAllPatches
++
;
}
}
// Reset the size of the boundary
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C
View file @
f7f6faa8
...
...
@@ -258,7 +258,10 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
// face is hit
label
cellI
=
p
.
cell
();
dt
*=
p
.
trackToFace
(
p
.
position
()
+
dt
*
U_
,
td
);
if
(
p
.
active
())
{
dt
*=
p
.
trackToFace
(
p
.
position
()
+
dt
*
U_
,
td
);
}
tEnd
-=
dt
;
p
.
stepFraction
()
=
1
.
0
-
tEnd
/
deltaT
;
...
...
@@ -322,6 +325,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
pp
,
this
->
face
(),
td
.
keepParticle
,
active_
,
U_
);
}
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H
View file @
f7f6faa8
...
...
@@ -194,6 +194,9 @@ protected:
// Parcel properties
//- Active flag - tracking inactive when active = false
bool
active_
;
//- Parcel type id
label
typeId_
;
...
...
@@ -308,6 +311,9 @@ public:
// Access
//- Return const access to active flag
inline
bool
active
()
const
;
//- Return const access to type id
inline
label
typeId
()
const
;
...
...
@@ -332,8 +338,11 @@ public:
// Edit
//- Return const access to active flag
inline
bool
&
active
();
//- Return access to type id
inline
label
typeId
();
inline
label
&
typeId
();
//- Return access to number of particles
inline
scalar
&
nParticle
();
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H
View file @
f7f6faa8
...
...
@@ -75,6 +75,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
)
:
Particle
<
ParcelType
>
(
owner
,
position
,
cellI
),
active_
(
false
),
typeId_
(
owner
.
parcelTypeId
()),
nParticle_
(
0
),
d_
(
0.0
),
...
...
@@ -102,6 +103,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
)
:
Particle
<
ParcelType
>
(
owner
,
position
,
cellI
),
active_
(
true
),
typeId_
(
typeId
),
nParticle_
(
nParticle0
),
d_
(
d0
),
...
...
@@ -201,6 +203,13 @@ Foam::KinematicParcel<ParcelType>::trackData::g() const
// * * * * * * * * * * KinematicParcel Member Functions * * * * * * * * * * //
template
<
class
ParcelType
>
inline
bool
Foam
::
KinematicParcel
<
ParcelType
>::
active
()
const
{
return
active_
;
}
template
<
class
ParcelType
>
inline
Foam
::
label
Foam
::
KinematicParcel
<
ParcelType
>::
typeId
()
const
{
...
...
@@ -251,7 +260,14 @@ inline const Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb() const
template
<
class
ParcelType
>
inline
Foam
::
label
Foam
::
KinematicParcel
<
ParcelType
>::
typeId
()
inline
bool
&
Foam
::
KinematicParcel
<
ParcelType
>::
active
()
{
return
active_
;
}
template
<
class
ParcelType
>
inline
Foam
::
label
&
Foam
::
KinematicParcel
<
ParcelType
>::
typeId
()
{
return
typeId_
;
}
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C
View file @
f7f6faa8
...
...
@@ -33,6 +33,7 @@ License
template
<
class
ParcelType
>
Foam
::
string
Foam
::
KinematicParcel
<
ParcelType
>::
propHeader
=
Particle
<
ParcelType
>::
propHeader
+
" active"
+
" typeId"
+
" nParticle"
+
" d"
...
...
@@ -53,6 +54,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
)
:
Particle
<
ParcelType
>
(
cloud
,
is
,
readFields
),
active_
(
false
),
typeId_
(
0
),
nParticle_
(
0
.
0
),
d_
(
0
.
0
),
...
...
@@ -68,6 +70,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
{
if
(
is
.
format
()
==
IOstream
::
ASCII
)
{
active_
=
readBool
(
is
);
typeId_
=
readLabel
(
is
);
nParticle_
=
readScalar
(
is
);
d_
=
readScalar
(
is
);
...
...
@@ -81,7 +84,8 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
is
.
read
(
reinterpret_cast
<
char
*>
(
&
typeId_
),
sizeof
(
typeId_
)
sizeof
(
active_
)
+
sizeof
(
typeId_
)
+
sizeof
(
nParticle_
)
+
sizeof
(
d_
)
+
sizeof
(
U_
)
...
...
@@ -111,6 +115,9 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
Particle
<
ParcelType
>::
readFields
(
c
);
IOField
<
label
>
active
(
c
.
fieldIOobject
(
"active"
,
IOobject
::
MUST_READ
));
c
.
checkFieldIOobject
(
c
,
active
);
IOField
<
label
>
typeId
(
c
.
fieldIOobject
(
"typeId"
,
IOobject
::
MUST_READ
));
c
.
checkFieldIOobject
(
c
,
typeId
);
...
...
@@ -138,6 +145,7 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
{
ParcelType
&
p
=
iter
();
p
.
active_
=
active
[
i
];
p
.
typeId_
=
typeId
[
i
];
p
.
nParticle_
=
nParticle
[
i
];
p
.
d_
=
d
[
i
];
...
...
@@ -157,6 +165,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
label
np
=
c
.
size
();
IOField
<
label
>
active
(
c
.
fieldIOobject
(
"active"
,
IOobject
::
NO_READ
),
np
);
IOField
<
label
>
typeId
(
c
.
fieldIOobject
(
"typeId"
,
IOobject
::
NO_READ
),
np
);
IOField
<
scalar
>
nParticle
(
...
...
@@ -174,6 +183,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
{
const
KinematicParcel
<
ParcelType
>&
p
=
iter
();
active
[
i
]
=
p
.
active
();
typeId
[
i
]
=
p
.
typeId
();
nParticle
[
i
]
=
p
.
nParticle
();
d
[
i
]
=
p
.
d
();
...
...
@@ -184,6 +194,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
i
++
;
}
active
.
write
();
typeId
.
write
();
nParticle
.
write
();
d
.
write
();
...
...
@@ -206,6 +217,7 @@ Foam::Ostream& Foam::operator<<
if
(
os
.
format
()
==
IOstream
::
ASCII
)
{
os
<<
static_cast
<
const
Particle
<
ParcelType
>&>
(
p
)
<<
token
::
SPACE
<<
p
.
active
()
<<
token
::
SPACE
<<
p
.
typeId
()
<<
token
::
SPACE
<<
p
.
nParticle
()
<<
token
::
SPACE
<<
p
.
d
()
...
...
@@ -219,8 +231,9 @@ Foam::Ostream& Foam::operator<<
os
<<
static_cast
<
const
Particle
<
ParcelType
>&>
(
p
);
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
p
.
typeId_
),
sizeof
(
p
.
typeId
())
reinterpret_cast
<
const
char
*>
(
&
p
.
active_
),
sizeof
(
p
.
active
())
+
sizeof
(
p
.
typeId
())
+
sizeof
(
p
.
nParticle
())
+
sizeof
(
p
.
d
())
+
sizeof
(
p
.
U
())
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
View file @
f7f6faa8
...
...
@@ -140,6 +140,7 @@ bool Foam::LocalInteraction<CloudType>::correct
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
{
...
...
@@ -158,18 +159,21 @@ bool Foam::LocalInteraction<CloudType>::correct
case
PatchInteractionModel
<
CloudType
>
:
:
itEscape
:
{
keepParticle
=
false
;
active
=
false
;
U
=
vector
::
zero
;
break
;
}
case
PatchInteractionModel
<
CloudType
>
:
:
itStick
:
{
keepParticle
=
true
;
active
=
false
;
U
=
vector
::
zero
;
break
;
}
case
PatchInteractionModel
<
CloudType
>
:
:
itRebound
:
{
keepParticle
=
true
;
active
=
true
;
vector
nw
=
pp
.
faceAreas
()[
pp
.
whichFace
(
faceId
)];
nw
/=
mag
(
nw
);
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H
View file @
f7f6faa8
...
...
@@ -92,6 +92,7 @@ public:
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
;
};
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H
View file @
f7f6faa8
...
...
@@ -155,6 +155,7 @@ public:
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
=
0
;
};
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C
View file @
f7f6faa8
...
...
@@ -61,10 +61,12 @@ bool Foam::Rebound<CloudType>::correct
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
{
keepParticle
=
true
;
active
=
true
;
vector
nw
=
pp
.
faceAreas
()[
pp
.
whichFace
(
faceId
)];
nw
/=
mag
(
nw
);
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.H
View file @
f7f6faa8
...
...
@@ -82,6 +82,7 @@ public:
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
;
};
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C
View file @
f7f6faa8
...
...
@@ -98,6 +98,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
{
...
...
@@ -108,18 +109,21 @@ bool Foam::StandardWallInteraction<CloudType>::correct
case
PatchInteractionModel
<
CloudType
>
:
:
itEscape
:
{
keepParticle
=
false
;
active
=
false
;
U
=
vector
::
zero
;
break
;
}
case
PatchInteractionModel
<
CloudType
>
:
:
itStick
:
{
keepParticle
=
true
;
active
=
false
;
U
=
vector
::
zero
;
break
;
}
case
PatchInteractionModel
<
CloudType
>
:
:
itRebound
:
{
keepParticle
=
true
;
active
=
true
;
vector
nw
=
pp
.
faceAreas
()[
pp
.
whichFace
(
faceId
)];
nw
/=
mag
(
nw
);
...
...
src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.H
View file @
f7f6faa8
...
...
@@ -102,6 +102,7 @@ public:
const
polyPatch
&
pp
,
const
label
faceId
,
bool
&
keepParticle
,
bool
&
active
,
vector
&
U
)
const
;
};
...
...
tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties
View file @
f7f6faa8
...
...
@@ -15,8 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
// Note: these are the properties for a "normalised" inviscid gas
// for which the speed of sound is 1 m/s at a temperature of 1K
// and gamma = 7/5
mixture normalisedGas 1 11640.3 2.5 0 0 1;
...
...
tutorials/compressible/rhoSonicFoam/forwardStep/constant/thermodynamicProperties
View file @
f7f6faa8
...
...
@@ -15,8 +15,10 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Note: these are the properties for a "normalised" inviscid gas
// for which the speed of sound is 1 m/s at a temperature of 1K
// and gamma = 7/5
Cv Cv [ 0 2 -2 -1 0 0 0 ] 1.78571;
R R [ 0 2 -2 -1 0 0 0 ] 0.714286;
...
...
tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties
View file @
f7f6faa8
...
...
@@ -15,9 +15,12 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<
e
ConstThermo<perfectGas>>>>>;
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<
h
ConstThermo<perfectGas>>>>>;
mixture air 1 11640.31 1.78571 0 0 0.7;
// Note: these are the properties for a "normalised" inviscid gas
// for which the speed of sound is 1 m/s at a temperature of 1K
// and gamma = 7/5
mixture normalisedGas 1 11640.31 2.5 0 0 1;
// ************************************************************************* //
tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/U
0 → 100644
View file @
f7f6faa8
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
outlet1
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
outlet2
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
baffles
{
type fixedValue;
value uniform ( 0 0 0 );
}
fan
{
type cyclic;
value uniform ( 0 0 0 );
}
defaultFaces
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* //
tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/epsilon
0 → 100644
View file @
f7f6faa8
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 1;
boundaryField
{
inlet
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.01; // 1cm - half channel height
value uniform 1;
}
outlet1
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
outlet2
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
baffles
{
type epsilonWallFunction;
value uniform 1;
}
fan
{
type cyclic;
value uniform 1;
}
defaultFaces
{
type epsilonWallFunction;
value uniform 1;
}
}
// ************************************************************************* //
tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/k
0 → 100644
View file @
f7f6faa8
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 1;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05; // 5% turbulent intensity
value uniform 1;
}
outlet1
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
outlet2
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
baffles
{
type kqRWallFunction;
value uniform 1;
}
fan
{
type cyclic;
value uniform 1;
}
defaultFaces
{
type kqRWallFunction;
value uniform 1;
}