Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2009-07-09 18:38:27 +01:00
285 changed files with 982 additions and 460 deletions

View File

@ -23,8 +23,9 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Extrude mesh from existing patch (flipped so has inwards pointing Extrude mesh from existing patch (by default outwards facing normals;
normals) or from patch read from file. optional flips faces)
or from patch read from file.
Note: Merges close points so be careful. Note: Merges close points so be careful.
Type of extrusion prescribed by run-time selectable model. Type of extrusion prescribed by run-time selectable model.
@ -108,14 +109,11 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[patchID]; const polyPatch& pp = mesh.boundaryMesh()[patchID];
fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints())); fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints()));
fMesh().flip();
{ {
fileName surfName(patchName + ".sMesh"); fileName surfName(runTime.path()/patchName + ".sMesh");
Info<< "Writing patch as surfaceMesh to "
Info<< "Writing (flipped) patch as surfaceMesh to "
<< surfName << nl << endl; << surfName << nl << endl;
OFstream os(surfName); OFstream os(surfName);
os << fMesh() << nl; os << fMesh() << nl;
} }
@ -142,6 +140,20 @@ int main(int argc, char *argv[])
<< "patch or surface." << exit(FatalError); << "patch or surface." << exit(FatalError);
} }
Switch flipNormals(dict.lookup("flipNormals"));
if (flipNormals)
{
Info<< "Flipping faces." << nl << endl;
faceList faces(fMesh().size());
forAll(faces, i)
{
faces[i] = fMesh()[i].reverseFace();
}
fMesh.reset(new faceMesh(faces, fMesh().localPoints()));
}
Info<< "Extruding patch with :" << nl Info<< "Extruding patch with :" << nl
<< " points : " << fMesh().points().size() << nl << " points : " << fMesh().points().size() << nl

View File

@ -47,7 +47,14 @@ linearNormal::linearNormal(const dictionary& dict)
: :
extrudeModel(typeName, dict), extrudeModel(typeName, dict),
thickness_(readScalar(coeffDict_.lookup("thickness"))) thickness_(readScalar(coeffDict_.lookup("thickness")))
{} {
if (thickness_ <= 0)
{
FatalErrorIn("linearNormal(const dictionary&)")
<< "thickness should be positive : " << thickness_
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -19,31 +19,40 @@ FoamFile
constructFrom patch; //surface; constructFrom patch; //surface;
// If construct from (flipped) patch // If construct from (flipped) patch
sourceCase "../cavity"; sourceCase "$FOAM_RUN/icoFoam/cavity";
sourcePatch movingWall; sourcePatch movingWall;
// Flip surface normals before usage.
flipNormals false;
// If construct from surface // If construct from surface
surface "movingWall.sMesh"; surface "movingWall.sMesh";
// Do front and back need to be merged? // Do front and back need to be merged? Usually only makes sense for 360
mergeFaces false; // degree wedges.
mergeFaces true;
//- Linear extrusion in point-normal direction //- Linear extrusion in point-normal direction
//extrudeModel linearNormal; //extrudeModel linearNormal;
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane. //- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
extrudeModel wedge; extrudeModel wedge;
//- Extrudes into sphere around (0 0 0) //- Extrudes into sphere around (0 0 0)
//extrudeModel linearRadial; //extrudeModel linearRadial;
//- Extrudes into sphere with grading according to pressure (atmospherics)
//extrudeModel sigmaRadial; //extrudeModel sigmaRadial;
nLayers 6; nLayers 20;
wedgeCoeffs wedgeCoeffs
{ {
axisPt (0 0.1 0); axisPt (0 0.1 0);
axis (1 0 0); axis (-1 0 0);
angle 90.0; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
linearNormalCoeffs linearNormalCoeffs

View File

@ -109,15 +109,33 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
label currentLayerOffset = layer*surfacePoints.size(); label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size(); label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces from layer to layer+1 // Vertical faces from layer to layer+1
for (label i=0; i<nInternalEdges; i++) for (label edgeI=0; edgeI<nInternalEdges; edgeI++)
{ {
quad[0] = surfaceEdges[i][1] + currentLayerOffset; const edge& e = surfaceEdges[edgeI];
quad[1] = surfaceEdges[i][0] + currentLayerOffset; const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
quad[2] = surfaceEdges[i][0] + nextLayerOffset;
quad[3] = surfaceEdges[i][1] + nextLayerOffset;
eFaces[facei++] = face(quad).reverseFace(); face& f = eFaces[facei++];
f.setSize(4);
if
(
(edgeFaces[0] < edgeFaces[1])
== sameOrder(surfaceFaces[edgeFaces[0]], e)
)
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
} }
// Faces between layer and layer+1 // Faces between layer and layer+1
@ -128,9 +146,9 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
eFaces[facei++] = eFaces[facei++] =
face face
( (
surfaceFaces[i].reverseFace() surfaceFaces[i] //.reverseFace()
+ nextLayerOffset + nextLayerOffset
).reverseFace(); );
} }
} }
} }
@ -142,40 +160,46 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
label nextLayerOffset = currentLayerOffset + surfacePoints.size(); label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces across layer // Side faces across layer
for (label i=nInternalEdges; i<surfaceEdges.size(); i++) for (label edgeI=nInternalEdges; edgeI<surfaceEdges.size(); edgeI++)
{ {
const edge& e = surfaceEdges[i]; const edge& e = surfaceEdges[edgeI];
quad[0] = e[1] + currentLayerOffset; const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
quad[1] = e[0] + currentLayerOffset;
quad[2] = e[0] + nextLayerOffset;
quad[3] = e[1] + nextLayerOffset;
label ownerFace = extrudePatch.edgeFaces()[i][0]; face& f = eFaces[facei++];
f.setSize(4);
if (sameOrder(surfaceFaces[ownerFace], e)) if (sameOrder(surfaceFaces[edgeFaces[0]], e))
{ {
reverse(quad); f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
} }
else
eFaces[facei++] = face(quad); {
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
} }
} }
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
} }
// Bottom faces // Bottom faces
forAll(surfaceFaces, i) forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
}
// Top faces
forAll(surfaceFaces, i)
{ {
eFaces[facei++] = eFaces[facei++] =
face face
( (
surfaceFaces[i].reverseFace() surfaceFaces[i]
+ nLayers*surfacePoints.size() + nLayers*surfacePoints.size()
).reverseFace(); );
} }
// return points for transferring // return points for transferring

View File

@ -67,8 +67,13 @@ Foam::label Foam::checkTopology
{ {
forAll(mesh.faceZones(), zoneI) forAll(mesh.faceZones(), zoneI)
{ {
if (mesh.faceZones()[zoneI].checkParallelSync(true)) if (mesh.faceZones()[zoneI].checkParallelSync(false))
{ {
Info<< " ***FaceZone " << mesh.faceZones()[zoneI].name()
<< " is not correctly synchronised"
<< " acrosss coupled boundaries."
<< " (coupled faces both"
<< " present in set but with opposite flipmap)" << endl;
noFailedChecks++; noFailedChecks++;
} }
} }

View File

@ -50,7 +50,7 @@ elif [ -d "./system" ]
then then
# Normal case. # Normal case.
parentDir=`dirname $PWD` parentDir=`dirname $PWD`
application=`basename $parentDir` application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication $application runApplication $application
else else

View File

@ -29,6 +29,11 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
getApplication ()
{
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
}
runApplication () runApplication ()
{ {
APP_RUN=$1; shift APP_RUN=$1; shift

View File

@ -60,7 +60,7 @@ class UniformDimensionedField
public: public:
//- Runtime type information //- Runtime type information
TypeName("DimensionedType"); TypeName("UniformDimensionedField");
// Constructors // Constructors

View File

@ -28,7 +28,7 @@ InClass
Description Description
SourceFiles SourceFiles
UniformDimensionedFields.C uniformDimensionedFields.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -100,6 +100,12 @@ Foam::label Foam::meshRefinement::createBaffle
<< " ownPatch:" << ownPatch << abort(FatalError); << " ownPatch:" << ownPatch << abort(FatalError);
} }
bool reverseFlip = false;
if (zoneID >= 0)
{
reverseFlip = !zoneFlip;
}
dupFaceI = meshMod.setAction dupFaceI = meshMod.setAction
( (
polyAddFace polyAddFace
@ -113,7 +119,7 @@ Foam::label Foam::meshRefinement::createBaffle
true, // face flip true, // face flip
neiPatch, // patch for face neiPatch, // patch for face
zoneID, // zone for face zoneID, // zone for face
!zoneFlip // face flip in zone reverseFlip // face flip in zone
) )
); );
} }

View File

@ -104,6 +104,7 @@ $(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
$(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C $(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
derivedFvPatchFields = $(fvPatchFields)/derived derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C $(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C

View File

@ -0,0 +1,274 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "activeBaffleVelocityFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(p, iF),
pName_("p"),
cyclicPatchName_(),
cyclicPatchLabel_(-1),
orientation_(1),
initWallSf_(0),
initCyclicSf_(0),
openFraction_(0),
openingTime_(0),
maxOpenFractionDelta_(0),
curTimeIndex_(-1)
{}
Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
pName_(ptf.pName_),
cyclicPatchName_(ptf.cyclicPatchName_),
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
orientation_(ptf.orientation_),
initWallSf_(ptf.initWallSf_),
initCyclicSf_(ptf.initCyclicSf_),
openFraction_(ptf.openFraction_),
openingTime_(ptf.openingTime_),
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
curTimeIndex_(-1)
{}
Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
pName_("p"),
cyclicPatchName_(dict.lookup("cyclicPatch")),
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
orientation_(readLabel(dict.lookup("orientation"))),
initWallSf_(p.Sf()),
initCyclicSf_(p.boundaryMesh()[cyclicPatchLabel_].Sf()),
openFraction_(readScalar(dict.lookup("openFraction"))),
openingTime_(readScalar(dict.lookup("openingTime"))),
maxOpenFractionDelta_(readScalar(dict.lookup("maxOpenFractionDelta"))),
curTimeIndex_(-1)
{
fvPatchVectorField::operator=(vector::zero);
if (dict.found("p"))
{
dict.lookup("p") >> pName_;
}
}
Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField& ptf
)
:
fixedValueFvPatchVectorField(ptf),
pName_(ptf.pName_),
cyclicPatchName_(ptf.cyclicPatchName_),
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
orientation_(ptf.orientation_),
initWallSf_(ptf.initWallSf_),
initCyclicSf_(ptf.initCyclicSf_),
openFraction_(ptf.openFraction_),
openingTime_(ptf.openingTime_),
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
curTimeIndex_(-1)
{}
Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField& ptf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(ptf, iF),
pName_(ptf.pName_),
cyclicPatchName_(ptf.cyclicPatchName_),
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
orientation_(ptf.orientation_),
initWallSf_(ptf.initWallSf_),
initCyclicSf_(ptf.initCyclicSf_),
openFraction_(ptf.openFraction_),
openingTime_(ptf.openingTime_),
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
curTimeIndex_(-1)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::activeBaffleVelocityFvPatchVectorField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchVectorField::autoMap(m);
//- Note: cannot map field from cyclic patch anyway so just recalculate
// Areas should be consistent when doing autoMap except in case of
// topo changes.
initWallSf_ = patch().Sf();
initCyclicSf_ = patch().boundaryMesh()[cyclicPatchLabel_].Sf();
}
void Foam::activeBaffleVelocityFvPatchVectorField::rmap
(
const fvPatchVectorField& ptf,
const labelList& addr
)
{
fixedValueFvPatchVectorField::rmap(ptf, addr);
//- Note: cannot map field from cyclic patch anyway so just recalculate
// Areas should be consistent when doing rmap (mainly reconstructPar)
initWallSf_ = patch().Sf();
initCyclicSf_ = patch().boundaryMesh()[cyclicPatchLabel_].Sf();
}
void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
// Execute the change to the openFraction only once per time-step
if (curTimeIndex_ != this->db().time().timeIndex())
{
const volScalarField& p = db().lookupObject<volScalarField>
(
pName_
);
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
label nCyclicFaces = cyclicFaceCells.size();
label nCyclicFacesPerSide = nCyclicFaces/2;
scalar forceDiff = 0;
for (label facei=0; facei<nCyclicFacesPerSide; facei++)
{
forceDiff += p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]);
}
for (label facei=nCyclicFacesPerSide; facei<nCyclicFaces; facei++)
{
forceDiff -= p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]);
}
openFraction_ =
max(min(
openFraction_
+ max
(
this->db().time().deltaT().value()/openingTime_,
maxOpenFractionDelta_
)
*(orientation_*sign(forceDiff)),
1 - 1e-6), 1e-6);
Info<< "openFraction = " << openFraction_ << endl;
vectorField::subField Sfw = patch().patch().faceAreas();
vectorField newSfw = (1 - openFraction_)*initWallSf_;
forAll(Sfw, facei)
{
Sfw[facei] = newSfw[facei];
}
const_cast<scalarField&>(patch().magSf()) = mag(patch().Sf());
const_cast<vectorField&>(cyclicPatch.Sf()) =
openFraction_*initCyclicSf_;
const_cast<scalarField&>(cyclicPatch.magSf()) =
mag(cyclicPatch.Sf());
curTimeIndex_ = this->db().time().timeIndex();
}
fixedValueFvPatchVectorField::updateCoeffs();
}
void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("cyclicPatch")
<< cyclicPatchName_ << token::END_STATEMENT << nl;
os.writeKeyword("orientation")
<< orientation_ << token::END_STATEMENT << nl;
os.writeKeyword("openingTime")
<< openingTime_ << token::END_STATEMENT << nl;
os.writeKeyword("maxOpenFractionDelta")
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl;
os.writeKeyword("openFraction")
<< openFraction_ << token::END_STATEMENT << nl;
os.writeKeyword("p")
<< pName_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
activeBaffleVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::activeBaffleVelocityFvPatchVectorField
Description
Boundary condition that modifies mesh areas based on velocity.
SourceFiles
activeBaffleVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef activeBaffleVelocityFvPatchVectorField_H
#define activeBaffleVelocityFvPatchVectorField_H
#include "fvPatchFields.H"
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class activeBaffleVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/
class activeBaffleVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
//- Name of the pressure field used to calculate the force
// on the active baffle
word pName_;
//- Name of the cyclic patch used when the active baffle is open
word cyclicPatchName_;
//- Index of the cyclic patch used when the active baffle is open
label cyclicPatchLabel_;
//- Orientation (1 or -1) of the active baffle patch.
// Used to change the direction of opening without the need for
// reordering the patch faces
label orientation_;
//- Initial wall patch areas
vectorField initWallSf_;
//- Initial cyclic patch areas
vectorField initCyclicSf_;
//- Current fraction of the active baffle which is open
scalar openFraction_;
//- Time taken for the active baffle to open
scalar openingTime_;
//- Maximum fractional change to the active baffle openness
// per time-step
scalar maxOpenFractionDelta_;
label curTimeIndex_;
public:
//- Runtime type information
TypeName("activeBaffleVelocity");
// Constructors
//- Construct from patch and internal field
activeBaffleVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
activeBaffleVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const dictionary&
);
//- Construct by mapping given activeBaffleVelocityFvPatchVectorField
// onto a new patch
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new activeBaffleVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
activeBaffleVelocityFvPatchVectorField
(
const activeBaffleVelocityFvPatchVectorField&,
const DimensionedField<vector, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchVectorField> clone
(
const DimensionedField<vector, volMesh>& iF
) const
{
return tmp<fvPatchVectorField>
(
new activeBaffleVelocityFvPatchVectorField(*this, iF)
);
}
// Member functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchVectorField&,
const labelList&
);
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -37,7 +37,7 @@ Foam::molecule::molecule
bool readFields bool readFields
) )
: :
Particle<molecule>(cloud, is, true), Particle<molecule>(cloud, is, readFields),
Q_(tensor::zero), Q_(tensor::zero),
v_(vector::zero), v_(vector::zero),
a_(vector::zero), a_(vector::zero),

View File

@ -2,8 +2,8 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name
application="dnsFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication boxTurb runApplication boxTurb

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application dnsFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,8 +2,8 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application directory # Get application name
application="laplacianFoam" application=`getApplication`
runAnsysToFoam() runAnsysToFoam()
{ {

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application laplacianFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -2,7 +2,7 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application="potentialFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication $application runApplication $application

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application potentialFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,7 +2,7 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application="potentialFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication $application runApplication $application

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application potentialFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application scalarTransportFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -9,7 +9,7 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class uniformDimensionedVectorField;
location "constant"; location "constant";
object g; object g;
} }

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application XiFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -9,7 +9,7 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class uniformDimensionedVectorField;
location "constant"; location "constant";
object g; object g;
} }

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application XiFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,7 +2,7 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Set application name
application="XiFoam" application="XiFoam"
setControlDict () { setControlDict () {

View File

@ -9,7 +9,7 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class uniformDimensionedVectorField;
location "constant"; location "constant";
object g; object g;
} }

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application XiFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -9,7 +9,7 @@ FoamFile
{ {
version 2.0; version 2.0;
format binary; format binary;
class dictionary; class uniformDimensionedVectorField;
location "constant"; location "constant";
object g; object g;
} }

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application dieselFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,8 +2,8 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name
application="engineFoam" application=`getApplication`
runKivaToFoam () runKivaToFoam ()
{ {

View File

@ -9,7 +9,7 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class uniformDimensionedVectorField;
location "constant"; location "constant";
object g; object g;
} }

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
applicationClass engineFoam; application engineFoam;
startFrom startTime; startFrom startTime;

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
applicationClass engineFoam; application engineFoam;
startFrom startTime; startFrom startTime;

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
applicationClass engineFoam; application engineFoam;
startFrom startTime; startFrom startTime;

View File

@ -2,8 +2,8 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name
application=${PWD##*/} application="rhoCentralFoam"
cases=" \ cases=" \
shockTube \ shockTube \

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom latestTime; startFrom latestTime;
startTime 0.005; startTime 0.005;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoCentralFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPimpleFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPisoFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPisoFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPorousSimpleFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPorousSimpleFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSonicFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Get application name
application="rhoSonicFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication setFields runApplication setFields

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSonicFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,7 +2,7 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application="rhopSonicFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication setFields runApplication setFields

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhopSonicFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhopSonicFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -1,5 +0,0 @@
#!/bin/sh
set -x
(cd laminar && ./Allrun)
(cd ras && ./Allrun)

View File

@ -1,22 +0,0 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=sonicFoam
cases=" \
forwardStep \
shockTube \
"
for case in $cases
do
(cd $case && runApplication blockMesh)
#
if [ "$case" = "shockTube" ] ; then
(cd $case && ./Allrun)
else
(cd $case && runApplication $application)
fi
#
done

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application sonicFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -2,7 +2,7 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application="sonicFoam" application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication setFields runApplication setFields

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application sonicFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -1,29 +0,0 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=${PWD##*/}
runStarToFoam ()
{
if [ -f log.starToFoam ] ; then
echo "starToFoam already run on $PWD: remove log file to run"
else
echo "starToFoam: converting mesh $1"
starToFoam $1 > log.starToFoam 2>&1
fi
}
# Do prism
(cd prism && foamRunTutorials)
# Special handling for nacaAirfoil
cd nacaAirfoil
runStarToFoam prostar/nacaAirfoil
mv constant/polyMesh/boundary temp
sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
temp > constant/polyMesh/boundary
rm temp
runApplication $application
cd ..

View File

@ -0,0 +1,23 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=`getApplication`
runStarToFoam ()
{
if [ -f log.starToFoam ] ; then
echo "starToFoam already run on $PWD: remove log file to run"
else
echo "starToFoam: converting mesh $1"
starToFoam $1 > log.starToFoam 2>&1
fi
}
runStarToFoam prostar/nacaAirfoil
mv constant/polyMesh/boundary temp
sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
temp > constant/polyMesh/boundary
rm temp
runApplication $application

View File

@ -6,7 +6,3 @@ nacaAirfoil
* limited 0.5 on all laplacianSchemes because the mesh is so poor * limited 0.5 on all laplacianSchemes because the mesh is so poor
* run to t = 0.02 with nextWrite; change to stopAt endTime to continue running * run to t = 0.02 with nextWrite; change to stopAt endTime to continue running
* deltaT can be increased later in the run to 2e-07 * deltaT can be increased later in the run to 2e-07
prism
~~~~~
* run to t = 0.0014 for convergence

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application sonicFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application sonicFoam;
startFrom latestTime; startFrom latestTime;
startTime 0; startTime 0;

View File

@ -2,8 +2,8 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory # Set application name
application=${PWD##*/} application="sonicLiquidFoam"
setDecompressionTankFine () setDecompressionTankFine ()
{ {

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application sonicLiquidFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

View File

@ -15,6 +15,8 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application dsmcFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 0;

Some files were not shown because too many files have changed in this diff Show More