mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -23,8 +23,9 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
Extrude mesh from existing patch (flipped so has inwards pointing
|
||||
normals) or from patch read from file.
|
||||
Extrude mesh from existing patch (by default outwards facing normals;
|
||||
optional flips faces)
|
||||
or from patch read from file.
|
||||
Note: Merges close points so be careful.
|
||||
|
||||
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];
|
||||
fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints()));
|
||||
fMesh().flip();
|
||||
|
||||
{
|
||||
fileName surfName(patchName + ".sMesh");
|
||||
|
||||
Info<< "Writing (flipped) patch as surfaceMesh to "
|
||||
fileName surfName(runTime.path()/patchName + ".sMesh");
|
||||
Info<< "Writing patch as surfaceMesh to "
|
||||
<< surfName << nl << endl;
|
||||
|
||||
OFstream os(surfName);
|
||||
os << fMesh() << nl;
|
||||
}
|
||||
@ -142,6 +140,20 @@ int main(int argc, char *argv[])
|
||||
<< "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
|
||||
<< " points : " << fMesh().points().size() << nl
|
||||
|
||||
@ -47,7 +47,14 @@ linearNormal::linearNormal(const dictionary& dict)
|
||||
:
|
||||
extrudeModel(typeName, dict),
|
||||
thickness_(readScalar(coeffDict_.lookup("thickness")))
|
||||
{}
|
||||
{
|
||||
if (thickness_ <= 0)
|
||||
{
|
||||
FatalErrorIn("linearNormal(const dictionary&)")
|
||||
<< "thickness should be positive : " << thickness_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -19,31 +19,40 @@ FoamFile
|
||||
constructFrom patch; //surface;
|
||||
|
||||
// If construct from (flipped) patch
|
||||
sourceCase "../cavity";
|
||||
sourceCase "$FOAM_RUN/icoFoam/cavity";
|
||||
sourcePatch movingWall;
|
||||
|
||||
// Flip surface normals before usage.
|
||||
flipNormals false;
|
||||
|
||||
// If construct from surface
|
||||
surface "movingWall.sMesh";
|
||||
|
||||
|
||||
// Do front and back need to be merged?
|
||||
mergeFaces false;
|
||||
// Do front and back need to be merged? Usually only makes sense for 360
|
||||
// degree wedges.
|
||||
mergeFaces true;
|
||||
|
||||
|
||||
//- Linear extrusion in point-normal direction
|
||||
//extrudeModel linearNormal;
|
||||
|
||||
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
||||
extrudeModel wedge;
|
||||
|
||||
//- Extrudes into sphere around (0 0 0)
|
||||
//extrudeModel linearRadial;
|
||||
|
||||
//- Extrudes into sphere with grading according to pressure (atmospherics)
|
||||
//extrudeModel sigmaRadial;
|
||||
|
||||
nLayers 6;
|
||||
nLayers 20;
|
||||
|
||||
wedgeCoeffs
|
||||
{
|
||||
axisPt (0 0.1 0);
|
||||
axis (1 0 0);
|
||||
angle 90.0; // For nLayers=1 assume symmetry so angle/2 on each side
|
||||
axis (-1 0 0);
|
||||
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
|
||||
}
|
||||
|
||||
linearNormalCoeffs
|
||||
|
||||
@ -109,15 +109,33 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
label currentLayerOffset = layer*surfacePoints.size();
|
||||
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
|
||||
|
||||
// Side faces from layer to layer+1
|
||||
for (label i=0; i<nInternalEdges; i++)
|
||||
// Vertical faces from layer to layer+1
|
||||
for (label edgeI=0; edgeI<nInternalEdges; edgeI++)
|
||||
{
|
||||
quad[0] = surfaceEdges[i][1] + currentLayerOffset;
|
||||
quad[1] = surfaceEdges[i][0] + currentLayerOffset;
|
||||
quad[2] = surfaceEdges[i][0] + nextLayerOffset;
|
||||
quad[3] = surfaceEdges[i][1] + nextLayerOffset;
|
||||
const edge& e = surfaceEdges[edgeI];
|
||||
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
|
||||
|
||||
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
|
||||
@ -128,9 +146,9 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
eFaces[facei++] =
|
||||
face
|
||||
(
|
||||
surfaceFaces[i].reverseFace()
|
||||
surfaceFaces[i] //.reverseFace()
|
||||
+ nextLayerOffset
|
||||
).reverseFace();
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -142,40 +160,46 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
|
||||
|
||||
// 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];
|
||||
quad[0] = e[1] + currentLayerOffset;
|
||||
quad[1] = e[0] + currentLayerOffset;
|
||||
quad[2] = e[0] + nextLayerOffset;
|
||||
quad[3] = e[1] + nextLayerOffset;
|
||||
const edge& e = surfaceEdges[edgeI];
|
||||
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
eFaces[facei++] = face(quad);
|
||||
else
|
||||
{
|
||||
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
|
||||
forAll(surfaceFaces, i)
|
||||
{
|
||||
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
|
||||
}
|
||||
|
||||
// Top faces
|
||||
forAll(surfaceFaces, i)
|
||||
{
|
||||
eFaces[facei++] =
|
||||
face
|
||||
(
|
||||
surfaceFaces[i].reverseFace()
|
||||
surfaceFaces[i]
|
||||
+ nLayers*surfacePoints.size()
|
||||
).reverseFace();
|
||||
);
|
||||
}
|
||||
|
||||
// return points for transferring
|
||||
|
||||
@ -67,8 +67,13 @@ Foam::label Foam::checkTopology
|
||||
{
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ elif [ -d "./system" ]
|
||||
then
|
||||
# Normal case.
|
||||
parentDir=`dirname $PWD`
|
||||
application=`basename $parentDir`
|
||||
application=`getApplication`
|
||||
runApplication blockMesh
|
||||
runApplication $application
|
||||
else
|
||||
|
||||
@ -29,6 +29,11 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
getApplication ()
|
||||
{
|
||||
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
|
||||
}
|
||||
|
||||
runApplication ()
|
||||
{
|
||||
APP_RUN=$1; shift
|
||||
|
||||
@ -60,7 +60,7 @@ class UniformDimensionedField
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("DimensionedType");
|
||||
TypeName("UniformDimensionedField");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -28,7 +28,7 @@ InClass
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
UniformDimensionedFields.C
|
||||
uniformDimensionedFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -100,6 +100,12 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
<< " ownPatch:" << ownPatch << abort(FatalError);
|
||||
}
|
||||
|
||||
bool reverseFlip = false;
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
reverseFlip = !zoneFlip;
|
||||
}
|
||||
|
||||
dupFaceI = meshMod.setAction
|
||||
(
|
||||
polyAddFace
|
||||
@ -113,7 +119,7 @@ Foam::label Foam::meshRefinement::createBaffle
|
||||
true, // face flip
|
||||
neiPatch, // patch for face
|
||||
zoneID, // zone for face
|
||||
!zoneFlip // face flip in zone
|
||||
reverseFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ $(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
|
||||
$(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
|
||||
|
||||
derivedFvPatchFields = $(fvPatchFields)/derived
|
||||
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -37,7 +37,7 @@ Foam::molecule::molecule
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
Particle<molecule>(cloud, is, true),
|
||||
Particle<molecule>(cloud, is, readFields),
|
||||
Q_(tensor::zero),
|
||||
v_(vector::zero),
|
||||
a_(vector::zero),
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application="dnsFoam"
|
||||
# Get application name
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication boxTurb
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application dnsFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application directory
|
||||
application="laplacianFoam"
|
||||
# Get application name
|
||||
application=`getApplication`
|
||||
|
||||
runAnsysToFoam()
|
||||
{
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application laplacianFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application="potentialFoam"
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication $application
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application potentialFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application="potentialFoam"
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication $application
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application potentialFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application scalarTransportFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -9,7 +9,7 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application XiFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -9,7 +9,7 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application XiFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
# Set application name
|
||||
application="XiFoam"
|
||||
|
||||
setControlDict () {
|
||||
|
||||
@ -9,7 +9,7 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application XiFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -9,7 +9,7 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format binary;
|
||||
class dictionary;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application dieselFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application="engineFoam"
|
||||
# Get application name
|
||||
application=`getApplication`
|
||||
|
||||
runKivaToFoam ()
|
||||
{
|
||||
|
||||
@ -9,7 +9,7 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
applicationClass engineFoam;
|
||||
application engineFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
applicationClass engineFoam;
|
||||
application engineFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
applicationClass engineFoam;
|
||||
application engineFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application=${PWD##*/}
|
||||
# Get application name
|
||||
application="rhoCentralFoam"
|
||||
|
||||
cases=" \
|
||||
shockTube \
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0.005;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoPimpleFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoPisoFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoPisoFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoPorousSimpleFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoPorousSimpleFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoSonicFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application="rhoSonicFoam"
|
||||
# Get application name
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication setFields
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoSonicFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application="rhopSonicFoam"
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication setFields
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhopSonicFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhopSonicFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
(cd laminar && ./Allrun)
|
||||
(cd ras && ./Allrun)
|
||||
@ -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
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application sonicFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application="sonicFoam"
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication setFields
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application sonicFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -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 ..
|
||||
23
tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun
Executable file
23
tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun
Executable 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
|
||||
@ -6,7 +6,3 @@ nacaAirfoil
|
||||
* 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
|
||||
* deltaT can be increased later in the run to 2e-07
|
||||
|
||||
prism
|
||||
~~~~~
|
||||
* run to t = 0.0014 for convergence
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application sonicFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application sonicFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application=${PWD##*/}
|
||||
# Set application name
|
||||
application="sonicLiquidFoam"
|
||||
|
||||
setDecompressionTankFine ()
|
||||
{
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application sonicLiquidFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -15,6 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application dsmcFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user