Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2013-08-20 12:06:29 +01:00
50 changed files with 745 additions and 15917 deletions

View File

@ -8,6 +8,10 @@
surfaceScalarField rAlphaAU1f(fvc::interpolate(alpha1*rAU1)); surfaceScalarField rAlphaAU1f(fvc::interpolate(alpha1*rAU1));
surfaceScalarField rAlphaAU2f(fvc::interpolate(alpha2*rAU2)); surfaceScalarField rAlphaAU2f(fvc::interpolate(alpha2*rAU2));
// Update the phi BCs from U before p BCs are updated
phi1.boundaryField() == (mesh.Sf().boundaryField() & U1.boundaryField());
phi2.boundaryField() == (mesh.Sf().boundaryField() & U2.boundaryField());
volVectorField HbyA1 volVectorField HbyA1
( (
IOobject::groupName("HbyA", phase1.name()), IOobject::groupName("HbyA", phase1.name()),

View File

@ -98,12 +98,11 @@ int main(int argc, char *argv[])
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Time = " << runTime.timeName() << nl << endl;
// Modify velocity by applying a 1/7th power law boundary-layer // Modify velocity by applying a 1/7th power law boundary-layer
// u/U0 = (y/ybl)^(1/7) // u/U0 = (y/ybl)^(1/7)
// assumes U0 is the same as the current cell velocity // assumes U0 is the same as the current cell velocity
Info<< "Setting boundary layer velocity" << nl << endl;
scalar yblv = ybl.value(); scalar yblv = ybl.value();
forAll(U, celli) forAll(U, celli)
{ {
@ -117,9 +116,15 @@ int main(int argc, char *argv[])
U.write(); U.write();
// Update/re-write phi // Update/re-write phi
phi = fvc::interpolate(U) & mesh.Sf(); #include "createPhi.H"
phi.write(); phi.write();
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
if (isA<incompressible::RASModel>(turbulence())) if (isA<incompressible::RASModel>(turbulence()))
{ {
@ -153,7 +158,6 @@ int main(int argc, char *argv[])
// Turbulence epsilon // Turbulence epsilon
tmp<volScalarField> tepsilon = turbulence->epsilon(); tmp<volScalarField> tepsilon = turbulence->epsilon();
volScalarField& epsilon = tepsilon(); volScalarField& epsilon = tepsilon();
scalar ce0 = ::pow(Cmu, 0.75)/kappa; scalar ce0 = ::pow(Cmu, 0.75)/kappa;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,15 +37,6 @@ License
mesh mesh
); );
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
Info<< "Calculating wall distance field" << endl; Info<< "Calculating wall distance field" << endl;
volScalarField y(wallDist(mesh).y()); volScalarField y(wallDist(mesh).y());

View File

@ -131,7 +131,7 @@ public:
( (
const word& entryName, const word& entryName,
const dictionary& dict, const dictionary& dict,
const word& ext = "Ceoffs" const word& ext = "Coeffs"
); );
//- Copy constructor //- Copy constructor

View File

@ -192,6 +192,7 @@ $(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchFiel
$(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C $(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
$(derivedFvPatchFields)/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C
fvsPatchFields = fields/fvsPatchFields fvsPatchFields = fields/fvsPatchFields
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C

View File

@ -0,0 +1,139 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ 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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interstitialInletVelocityFvPatchVectorField.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::interstitialInletVelocityFvPatchVectorField::
interstitialInletVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchField<vector>(p, iF),
inletVelocity_(p.size(), vector::zero),
alphaName_("alpha")
{}
Foam::interstitialInletVelocityFvPatchVectorField::
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
inletVelocity_(ptf.inletVelocity_),
alphaName_(ptf.alphaName_)
{}
Foam::interstitialInletVelocityFvPatchVectorField::
interstitialInletVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
inletVelocity_("inletVelocity", dict, p.size()),
alphaName_(dict.lookupOrDefault<word>("alpha", "alpha"))
{}
Foam::interstitialInletVelocityFvPatchVectorField::
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField& ptf
)
:
fixedValueFvPatchField<vector>(ptf),
inletVelocity_(ptf.inletVelocity_),
alphaName_(ptf.alphaName_)
{}
Foam::interstitialInletVelocityFvPatchVectorField::
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField& ptf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchField<vector>(ptf, iF),
inletVelocity_(ptf.inletVelocity_),
alphaName_(ptf.alphaName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
const fvPatchField<scalar>& alphap =
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
operator==(inletVelocity_/alphap);
fixedValueFvPatchField<vector>::updateCoeffs();
}
void Foam::interstitialInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
writeEntryIfDifferent<word>(os, "alpha", "alpha", alphaName_);
inletVelocity_.writeEntry("inletVelocity", os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
interstitialInletVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ 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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interstitialInletVelocityFvPatchVectorField
Description
Inlet velocity in which the actual interstitial velocity is calculated
by dividing the specified inletVelocity field with the local phase-fraction.
Example of the boundary condition specification:
\verbatim
inlet
{
type interstitialInletVelocity;
inletVelocity uniform (0 0.2 0; // Non-interstitial inlet velocity
alpha alpha.particles; // Name of the phase-fraction field
value uniform (0 0 0);
}
\endverbatim
SourceFiles
interstitialInletVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef interstitialInletVelocityFvPatchVectorField_H
#define interstitialInletVelocityFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interstitialInletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/
class interstitialInletVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
//- Inlet velocity
vectorField inletVelocity_;
//- Name of the flux transporting the field
word alphaName_;
public:
//- Runtime type information
TypeName("interstitialInletVelocity");
// Constructors
//- Construct from patch and internal field
interstitialInletVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
interstitialInletVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// interstitialInletVelocityFvPatchVectorField
// onto a new patch
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new interstitialInletVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
interstitialInletVelocityFvPatchVectorField
(
const interstitialInletVelocityFvPatchVectorField&,
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 interstitialInletVelocityFvPatchVectorField(*this, iF)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,16 +44,22 @@ void Foam::Cloud<ParticleType>::checkPatches() const
{ {
if (isA<cyclicAMIPolyPatch>(pbm[patchI])) if (isA<cyclicAMIPolyPatch>(pbm[patchI]))
{ {
ok = false; const cyclicAMIPolyPatch& cami =
break; refCast<const cyclicAMIPolyPatch>(pbm[patchI]);
if (cami.owner())
{
ok = ok && (cami.AMI().singlePatchProc() != -1);
}
} }
} }
if (!ok) if (!ok)
{ {
WarningIn("void Foam::Cloud<ParticleType>::initCloud(const bool)") FatalErrorIn("void Foam::Cloud<ParticleType>::initCloud(const bool)")
<< "Particle tracking across AMI patches is not currently " << "Particle tracking across AMI patches is only currently "
<< "supported" << endl; << "supported for cases where the AMI patches reside on a "
<< "single processor" << abort(FatalError);
} }
} }

View File

@ -257,6 +257,15 @@ protected:
template<class TrackData> template<class TrackData>
void hitCyclicPatch(const cyclicPolyPatch&, TrackData& td); void hitCyclicPatch(const cyclicPolyPatch&, TrackData& td);
//- Overridable function to handle the particle hitting a cyclicAMIPatch
template<class TrackData>
void hitCyclicAMIPatch
(
const cyclicAMIPolyPatch&,
TrackData& td,
const vector& direction
);
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// processorPatch // processorPatch
template<class TrackData> template<class TrackData>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ License
#include "IOPosition.H" #include "IOPosition.H"
#include "cyclicPolyPatch.H" #include "cyclicPolyPatch.H"
#include "cyclicAMIPolyPatch.H"
#include "processorPolyPatch.H" #include "processorPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
@ -598,6 +599,15 @@ Foam::scalar Foam::particle::trackToFace
static_cast<const cyclicPolyPatch&>(patch), td static_cast<const cyclicPolyPatch&>(patch), td
); );
} }
else if (isA<cyclicAMIPolyPatch>(patch))
{
p.hitCyclicAMIPatch
(
static_cast<const cyclicAMIPolyPatch&>(patch),
td,
endPosition - position_
);
}
else if (isA<processorPolyPatch>(patch)) else if (isA<processorPolyPatch>(patch))
{ {
p.hitProcessorPatch p.hitProcessorPatch
@ -1010,6 +1020,78 @@ void Foam::particle::hitCyclicPatch
} }
template<class TrackData>
void Foam::particle::hitCyclicAMIPatch
(
const cyclicAMIPolyPatch& cpp,
TrackData& td,
const vector& direction
)
{
const cyclicAMIPolyPatch& receiveCpp = cpp.neighbPatch();
// patch face index on sending side
label patchFaceI = faceI_ - cpp.start();
// patch face index on receiving side - also updates position
patchFaceI = cpp.pointFace(patchFaceI, direction, position_);
if (patchFaceI < 0)
{
FatalErrorIn
(
"template<class TrackData>"
"void Foam::particle::hitCyclicAMIPatch"
"("
"const cyclicAMIPolyPatch&, "
"TrackData&, "
"const vector&"
")"
)
<< "Particle lost across " << cyclicAMIPolyPatch::typeName
<< " patches " << cpp.name() << " and " << receiveCpp.name()
<< " at position " << position_ << abort(FatalError);
}
// convert face index into global numbering
faceI_ = patchFaceI + receiveCpp.start();
cellI_ = mesh_.faceOwner()[faceI_];
tetFaceI_ = faceI_;
// See note in correctAfterParallelTransfer for tetPtI_ addressing.
tetPtI_ = mesh_.faces()[tetFaceI_].size() - 1 - tetPtI_;
// Now the particle is on the receiving side
// Have patch transform the position
receiveCpp.transformPosition(position_, patchFaceI);
// Transform the properties
if (!receiveCpp.parallel())
{
const tensor& T =
(
receiveCpp.forwardT().size() == 1
? receiveCpp.forwardT()[0]
: receiveCpp.forwardT()[patchFaceI]
);
transformProperties(T);
}
else if (receiveCpp.separated())
{
const vector& s =
(
(receiveCpp.separation().size() == 1)
? receiveCpp.separation()[0]
: receiveCpp.separation()[patchFaceI]
);
transformProperties(-s);
}
}
template<class TrackData> template<class TrackData>
void Foam::particle::hitProcessorPatch(const processorPolyPatch&, TrackData&) void Foam::particle::hitProcessorPatch(const processorPolyPatch&, TrackData&)
{} {}

View File

@ -100,6 +100,8 @@ bool Foam::CollidingParcel<ParcelType>::move
// Apply correction to position for reduced-D cases // Apply correction to position for reduced-D cases
meshTools::constrainToMeshCentre(mesh, p.position()); meshTools::constrainToMeshCentre(mesh, p.position());
const point start(p.position());
// Set the Lagrangian time-step // Set the Lagrangian time-step
scalar dt = min(dtMax, tEnd); scalar dt = min(dtMax, tEnd);
@ -145,7 +147,14 @@ bool Foam::CollidingParcel<ParcelType>::move
p.age() += dt; p.age() += dt;
td.cloud().functions().postMove(p, cellI, dt, td.keepParticle); td.cloud().functions().postMove
(
p,
cellI,
dt,
start,
td.keepParticle
);
} }
break; break;

View File

@ -276,6 +276,8 @@ bool Foam::KinematicParcel<ParcelType>::move
// Apply correction to position for reduced-D cases // Apply correction to position for reduced-D cases
meshTools::constrainToMeshCentre(mesh, p.position()); meshTools::constrainToMeshCentre(mesh, p.position());
const point start(p.position());
// Set the Lagrangian time-step // Set the Lagrangian time-step
scalar dt = min(dtMax, tEnd); scalar dt = min(dtMax, tEnd);
@ -320,7 +322,7 @@ bool Foam::KinematicParcel<ParcelType>::move
p.age() += dt; p.age() += dt;
td.cloud().functions().postMove(p, cellI, dt, td.keepParticle); td.cloud().functions().postMove(p, cellI, dt, start, td.keepParticle);
} }
return td.keepParticle; return td.keepParticle;

View File

@ -372,7 +372,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
td.cloud().hsTrans()[cellI] += dm*HsEff(td, pc, T0, idG, idL, idS); td.cloud().hsTrans()[cellI] += dm*HsEff(td, pc, T0, idG, idL, idS);
td.cloud().phaseChange().addToPhaseChangeMass(dm); td.cloud().phaseChange().addToPhaseChangeMass(np0*mass1);
} }
return; return;

View File

@ -530,7 +530,7 @@ void Foam::ReactingParcel<ParcelType>::calc
} }
td.cloud().UTrans()[cellI] += dm*U0; td.cloud().UTrans()[cellI] += dm*U0;
td.cloud().phaseChange().addToPhaseChangeMass(dm); td.cloud().phaseChange().addToPhaseChangeMass(np0*mass1);
} }
return; return;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -97,6 +97,7 @@ void Foam::CloudFunctionObject<CloudType>::postMove
const typename CloudType::parcelType&, const typename CloudType::parcelType&,
const label, const label,
const scalar, const scalar,
const point&,
bool& bool&
) )
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -138,6 +138,7 @@ public:
const typename CloudType::parcelType& p, const typename CloudType::parcelType& p,
const label cellI, const label cellI,
const scalar dt, const scalar dt,
const point& position0,
bool& keepParticle bool& keepParticle
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -133,12 +133,13 @@ void Foam::CloudFunctionObjectList<CloudType>::postMove
const typename CloudType::parcelType& p, const typename CloudType::parcelType& p,
const label cellI, const label cellI,
const scalar dt, const scalar dt,
const point& position0,
bool& keepParticle bool& keepParticle
) )
{ {
forAll(*this, i) forAll(*this, i)
{ {
this->operator[](i).postMove(p, cellI, dt, keepParticle); this->operator[](i).postMove(p, cellI, dt, position0, keepParticle);
if (!keepParticle) if (!keepParticle)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -115,6 +115,7 @@ public:
const typename CloudType::parcelType& p, const typename CloudType::parcelType& p,
const label cellI, const label cellI,
const scalar dt, const scalar dt,
const point& position0,
bool& keepParticle bool& keepParticle
); );

View File

@ -64,13 +64,29 @@ void Foam::ParticleCollector<CloudType>::makeLogFile
outputFilePtr_() outputFilePtr_()
<< "# Source : " << type() << nl << "# Source : " << type() << nl
<< "# Total area : " << sum(area) << nl << "# Total area : " << sum(area) << nl;
<< "# Time";
outputFilePtr_() << "# Geometry :" << nl;
forAll(faces, i)
{
word id = Foam::name(i);
outputFilePtr_()
<< '#' << tab << "point[" << id << "] = "
<< faces[i].centre(points) << nl;
}
outputFilePtr_()<< '#' << nl << "# Time";
forAll(faces, i) forAll(faces, i)
{ {
word id = Foam::name(i); word id = Foam::name(i);
if (i != 0)
{
outputFilePtr_() << "#";
}
outputFilePtr_() outputFilePtr_()
<< tab << "area[" << id << "]" << tab << "area[" << id << "]"
<< tab << "mass[" << id << "]" << tab << "mass[" << id << "]"
@ -265,13 +281,10 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
template<class CloudType> template<class CloudType>
Foam::label Foam::ParticleCollector<CloudType>::collectParcelPolygon Foam::label Foam::ParticleCollector<CloudType>::collectParcelPolygon
( (
const point& position, const point& p1,
const vector& U, const point& p2
const scalar dt
) const ) const
{ {
point end(position + dt*U);
label dummyNearType = -1; label dummyNearType = -1;
label dummyNearLabel = -1; label dummyNearLabel = -1;
@ -279,10 +292,10 @@ Foam::label Foam::ParticleCollector<CloudType>::collectParcelPolygon
{ {
const label facePoint0 = faces_[faceI][0]; const label facePoint0 = faces_[faceI][0];
const point p0 = points_[facePoint0]; const point& pf = points_[facePoint0];
const scalar d1 = normal_ & (position - p0); const scalar d1 = normal_ & (p1 - pf);
const scalar d2 = normal_ & (end - p0); const scalar d2 = normal_ & (p2 - pf);
if (sign(d1) == sign(d2)) if (sign(d1) == sign(d2))
{ {
@ -291,7 +304,7 @@ Foam::label Foam::ParticleCollector<CloudType>::collectParcelPolygon
} }
// intersection point // intersection point
point pIntersect = position + (d1/(d1 - d2))*dt*U; const point pIntersect = p1 + (d1/(d1 - d2))*(p2 - p1);
const List<face>& tris = faceTris_[faceI]; const List<face>& tris = faceTris_[faceI];
@ -320,17 +333,14 @@ Foam::label Foam::ParticleCollector<CloudType>::collectParcelPolygon
template<class CloudType> template<class CloudType>
Foam::label Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles Foam::label Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
( (
const point& position, const point& p1,
const vector& U, const point& p2
const scalar dt
) const ) const
{ {
label secI = -1; label secI = -1;
point end(position + dt*U); const scalar d1 = normal_ & (p1 - coordSys_.origin());
const scalar d2 = normal_ & (p2 - coordSys_.origin());
const scalar d1 = normal_ & (position - coordSys_.origin());
const scalar d2 = normal_ & (end - coordSys_.origin());
if (sign(d1) == sign(d2)) if (sign(d1) == sign(d2))
{ {
@ -339,7 +349,7 @@ Foam::label Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
} }
// intersection point in cylindrical co-ordinate system // intersection point in cylindrical co-ordinate system
point pCyl = coordSys_.localPosition(position + (d1/(d1 - d2))*dt*U); const point pCyl = coordSys_.localPosition(p1 + (d1/(d1 - d2))*(p2 - p1));
scalar r = pCyl[0]; scalar r = pCyl[0];
@ -408,6 +418,9 @@ void Foam::ParticleCollector<CloudType>::write()
Field<scalar> faceMassFlowRate(massFlowRate_.size(), 0.0); Field<scalar> faceMassFlowRate(massFlowRate_.size(), 0.0);
this->getModelProperty("massFlowRate", faceMassFlowRate); this->getModelProperty("massFlowRate", faceMassFlowRate);
scalar sumTotalMass = 0.0;
scalar sumAverageMFR = 0.0;
forAll(faces_, faceI) forAll(faces_, faceI)
{ {
scalarList allProcMass(Pstream::nProcs()); scalarList allProcMass(Pstream::nProcs());
@ -420,10 +433,8 @@ void Foam::ParticleCollector<CloudType>::write()
Pstream::gatherList(allProcMassFlowRate); Pstream::gatherList(allProcMassFlowRate);
faceMassFlowRate[faceI] += sum(allProcMassFlowRate); faceMassFlowRate[faceI] += sum(allProcMassFlowRate);
Info<< " face " << faceI sumTotalMass += faceMassTotal[faceI];
<< ": total mass = " << faceMassTotal[faceI] sumAverageMFR += faceMassFlowRate[faceI];
<< "; average mass flow rate = " << faceMassFlowRate[faceI]
<< nl;
if (outputFilePtr_.valid()) if (outputFilePtr_.valid())
{ {
@ -435,7 +446,9 @@ void Foam::ParticleCollector<CloudType>::write()
} }
} }
Info<< endl; Info<< " sum(total mass) = " << sumTotalMass << nl
<< " sum(average mass flow rate) = " << sumAverageMFR << nl
<< endl;
if (surfaceFormat_ != "none") if (surfaceFormat_ != "none")
@ -554,16 +567,17 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
} }
else else
{ {
FatalErrorIn FatalIOErrorIn
( (
"Foam::ParticleCollector<CloudType>::ParticleCollector" "Foam::ParticleCollector<CloudType>::ParticleCollector"
"(" "("
"const dictionary&," "const dictionary&,"
"CloudType&" "CloudType&"
")" ")",
this->coeffDict()
) )
<< "Unknown mode " << mode << ". Available options are " << "Unknown mode " << mode << ". Available options are "
<< "polygon and concentricCircle" << exit(FatalError); << "polygon and concentricCircle" << exit(FatalIOError);
} }
mass_.setSize(faces_.size(), 0.0); mass_.setSize(faces_.size(), 0.0);
@ -620,6 +634,7 @@ void Foam::ParticleCollector<CloudType>::postMove
const parcelType& p, const parcelType& p,
const label cellI, const label cellI,
const scalar dt, const scalar dt,
const point& position0,
bool& keepParticle bool& keepParticle
) )
{ {
@ -630,16 +645,19 @@ void Foam::ParticleCollector<CloudType>::postMove
label faceI = -1; label faceI = -1;
// slightly extend end position to avoid falling within tracking tolerances
const point position1 = position0 + 1.0001*(p.position() - position0);
switch (mode_) switch (mode_)
{ {
case mtPolygon: case mtPolygon:
{ {
faceI = collectParcelPolygon(p.position(), p.U(), dt); faceI = collectParcelPolygon(position0, position1);
break; break;
} }
case mtConcentricCircle: case mtConcentricCircle:
{ {
faceI = collectParcelConcentricCircles(p.position(), p.U(), dt); faceI = collectParcelConcentricCircles(position0, position1);
break; break;
} }
default: default:

View File

@ -169,17 +169,15 @@ private:
//- Collect parcels in polygon collectors //- Collect parcels in polygon collectors
label collectParcelPolygon label collectParcelPolygon
( (
const point& position, const point& p1,
const vector& U, const point& p2
const scalar dt
) const; ) const;
//- Collect parcels in concentric circle collectors //- Collect parcels in concentric circle collectors
label collectParcelConcentricCircles label collectParcelConcentricCircles
( (
const point& position, const point& p1,
const vector& U, const point& p2
const scalar dt
) const; ) const;
@ -235,6 +233,7 @@ public:
const parcelType& p, const parcelType& p,
const label cellI, const label cellI,
const scalar dt, const scalar dt,
const point& position0,
bool& keepParticle bool& keepParticle
); );
}; };

View File

@ -155,7 +155,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
const scalarField X(liquids_.X(Yl)); const scalarField X(liquids_.X(Yl));
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition
if (mag(T - liquids_.Tc(X)) < SMALL) if ((liquids_.Tc(X) - T) < SMALL)
{ {
if (debug) if (debug)
{ {

View File

@ -155,7 +155,7 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
const scalarField X(liquids_.X(Yl)); const scalarField X(liquids_.X(Yl));
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition
if (mag(T - liquids_.Tc(X)) < SMALL) if ((liquids_.Tc(X) - T) < SMALL)
{ {
if (debug) if (debug)
{ {

View File

@ -1248,6 +1248,114 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
} }
template<class SourcePatch, class TargetPatch>
Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcPointFace
(
const SourcePatch& srcPatch,
const TargetPatch& tgtPatch,
const vector& n,
const label tgtFaceI,
point& tgtPoint
)
const
{
const pointField& srcPoints = srcPatch.points();
// source face addresses that intersect target face tgtFaceI
const labelList& addr = tgtAddress_[tgtFaceI];
forAll(addr, i)
{
label srcFaceI = addr[i];
const face& f = srcPatch[tgtFaceI];
pointHit ray = f.ray(tgtPoint, n, srcPoints);
if (ray.hit())
{
tgtPoint = ray.rawPoint();
return srcFaceI;
}
}
// no hit registered - try with face normal instead of input normal
forAll(addr, i)
{
label srcFaceI = addr[i];
const face& f = srcPatch[tgtFaceI];
vector nFace(-srcPatch.faceNormals()[srcFaceI]);
nFace += tgtPatch.faceNormals()[tgtFaceI];
pointHit ray = f.ray(tgtPoint, nFace, srcPoints);
if (ray.hit())
{
tgtPoint = ray.rawPoint();
return srcFaceI;
}
}
return -1;
}
template<class SourcePatch, class TargetPatch>
Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::tgtPointFace
(
const SourcePatch& srcPatch,
const TargetPatch& tgtPatch,
const vector& n,
const label srcFaceI,
point& srcPoint
)
const
{
const pointField& tgtPoints = tgtPatch.points();
// target face addresses that intersect source face srcFaceI
const labelList& addr = srcAddress_[srcFaceI];
forAll(addr, i)
{
label tgtFaceI = addr[i];
const face& f = tgtPatch[tgtFaceI];
pointHit ray = f.ray(srcPoint, n, tgtPoints);
if (ray.hit())
{
srcPoint = ray.rawPoint();
return tgtFaceI;
}
}
// no hit registered - try with face normal instead of input normal
forAll(addr, i)
{
label tgtFaceI = addr[i];
const face& f = tgtPatch[tgtFaceI];
vector nFace(-srcPatch.faceNormals()[srcFaceI]);
nFace += tgtPatch.faceNormals()[tgtFaceI];
pointHit ray = f.ray(srcPoint, n, tgtPoints);
if (ray.hit())
{
srcPoint = ray.rawPoint();
return tgtFaceI;
}
}
return -1;
}
template<class SourcePatch, class TargetPatch> template<class SourcePatch, class TargetPatch>
void Foam::AMIInterpolation<SourcePatch, TargetPatch>::writeFaceConnectivity void Foam::AMIInterpolation<SourcePatch, TargetPatch>::writeFaceConnectivity
( (

View File

@ -454,6 +454,31 @@ public:
) const; ) const;
// Point intersections
//- Return source patch face index of point on target patch face
label srcPointFace
(
const SourcePatch& srcPatch,
const TargetPatch& tgtPatch,
const vector& n,
const label tgtFaceI,
point& tgtPoint
)
const;
//- Return target patch face index of point on source patch face
label tgtPointFace
(
const SourcePatch& srcPatch,
const TargetPatch& tgtPatch,
const vector& n,
const label srcFaceI,
point& srcPoint
)
const;
// Checks // Checks
//- Write face connectivity as OBJ file //- Write face connectivity as OBJ file

View File

@ -797,6 +797,38 @@ bool Foam::cyclicAMIPolyPatch::order
} }
Foam::label Foam::cyclicAMIPolyPatch::pointFace
(
const label faceI,
const vector& n,
point& p
) const
{
if (owner())
{
return AMI().tgtPointFace
(
*this,
neighbPatch(),
n,
faceI,
p
);
}
else
{
return neighbPatch().AMI().srcPointFace
(
neighbPatch(),
*this,
n,
faceI,
p
);
}
}
void Foam::cyclicAMIPolyPatch::write(Ostream& os) const void Foam::cyclicAMIPolyPatch::write(Ostream& os) const
{ {
coupledPolyPatch::write(os); coupledPolyPatch::write(os);

View File

@ -367,6 +367,15 @@ public:
labelList& rotation labelList& rotation
) const; ) const;
//- Return face index on neighbour patch which shares point p
// following trajectory vector n
label pointFace
(
const label faceI,
const vector& n,
point& p
) const;
//- Write the polyPatch data as a dictionary //- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -78,6 +78,10 @@ void Foam::removeRegisteredObject::execute()
if (obj.ownedByRegistry()) if (obj.ownedByRegistry())
{ {
Info<< type() << " " << name_ << " output:" << nl
<< " removing object " << obj.name() << nl
<< endl;
const_cast<regIOobject&>(obj).release(); const_cast<regIOobject&>(obj).release();
delete &obj; delete &obj;
} }

View File

@ -63,7 +63,7 @@ bool Foam::writeDictionary::tryFolder
{ {
if (firstDict) if (firstDict)
{ {
Info<< type() << " output:" << nl << endl; Info<< type() << " " << name_ << " output:" << nl << endl;
IOobject::writeDivider(Info); IOobject::writeDivider(Info);
Info<< endl; Info<< endl;

View File

@ -98,6 +98,11 @@ void Foam::writeRegisteredObject::write()
); );
// Switch off automatic writing to prevent double write // Switch off automatic writing to prevent double write
obj.writeOpt() = IOobject::NO_WRITE; obj.writeOpt() = IOobject::NO_WRITE;
Info<< type() << " " << name_ << " output:" << nl
<< " writing object " << obj.name() << nl
<< endl;
obj.write(); obj.write();
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,8 +52,8 @@ void Foam::calcFvcDiv::calcDiv
field = fvc::div(vf); field = fvc::div(vf);
Info<< type() << " output:" << nl Info<< type() << " " << name_ << " output:" << nl
<< " writing " << field.name() << " field" << nl << endl; << " writing field " << field.name() << nl << endl;
field.write(); field.write();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -120,8 +120,8 @@ void Foam::calcFvcGrad::calcGrad
field = fvc::grad(sf); field = fvc::grad(sf);
Info<< type() << " output:" << nl Info<< type() << " " << name_ << " output:" << nl
<< " writing " << field.name() << " field" << nl << endl; << " writing field " << field.name() << nl << endl;
field.write(); field.write();

View File

@ -198,10 +198,11 @@ void Foam::CourantNo::write()
CourantNo.correctBoundaryConditions(); CourantNo.correctBoundaryConditions();
CourantNo.write(); Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << CourantNo.name() << nl
<< endl;
Info<< type() << " output:" << nl CourantNo.write();
<< " writing " << CourantNo.name() << " field" << nl << endl;
} }
} }

View File

@ -136,7 +136,7 @@ void Foam::DESModelRegions::write()
if (log_) if (log_)
{ {
Info<< type() << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
} }
tmp<volScalarField> tresult; tmp<volScalarField> tresult;
@ -186,6 +186,7 @@ void Foam::DESModelRegions::write()
{ {
Info<< " LES = " << prc << " % (volume)" << nl Info<< " LES = " << prc << " % (volume)" << nl
<< " RAS = " << 100.0 - prc << " % (volume)" << nl << " RAS = " << 100.0 - prc << " % (volume)" << nl
<< " writing field " << result.name() << nl
<< endl; << endl;
} }

View File

@ -157,10 +157,11 @@ void Foam::Lambda2::write()
Lambda2 = -eigenValues(SSplusWW)().component(vector::Y); Lambda2 = -eigenValues(SSplusWW)().component(vector::Y);
Lambda2.write(); Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << Lambda2.name() << nl
<< endl;
Info<< type() << " output:" << nl Lambda2.write();
<< " writing " << Lambda2.name() << " field" << nl << endl;
} }
} }

View File

@ -209,10 +209,11 @@ void Foam::Peclet::write()
*fvc::interpolate(nuEff) *fvc::interpolate(nuEff)
); );
Peclet.write(); Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << Peclet.name() << nl
<< endl;
Info<< type() << " output:" << nl Peclet.write();
<< " writing " << Peclet.name() << " field" << nl << endl;
} }
} }

View File

@ -150,10 +150,11 @@ void Foam::Q::write()
Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU)))); Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU))));
Q.write(); Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << Q.name() << nl
<< endl;
Info<< type() << " output:" << nl Q.write();
<< " writing " << Q.name() << " field" << nl << endl;
} }
} }

View File

@ -322,6 +322,10 @@ void Foam::pressureTools::write()
pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef()); pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef());
Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << pResult.name() << nl
<< endl;
pResult.write(); pResult.write();
} }
} }

View File

@ -234,7 +234,7 @@ void Foam::wallShearStress::write()
if (log_) if (log_)
{ {
Info<< type() << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
} }
@ -265,7 +265,8 @@ void Foam::wallShearStress::write()
if (log_) if (log_)
{ {
Info<< endl; Info<< " writing field " << wallShearStress.name() << nl
<< endl;
} }
wallShearStress.write(); wallShearStress.write();

View File

@ -282,7 +282,7 @@ void Foam::yPlusLES::write()
if (log_) if (log_)
{ {
Info<< type() << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
} }
if (phi.dimensions() == dimMass/dimTime) if (phi.dimensions() == dimMass/dimTime)
@ -296,7 +296,8 @@ void Foam::yPlusLES::write()
if (log_) if (log_)
{ {
Info<< endl; Info<< " writing field " << yPlusLES.name() << nl
<< endl;
} }
yPlusLES.write(); yPlusLES.write();

View File

@ -267,7 +267,7 @@ void Foam::yPlusRAS::write()
if (log_) if (log_)
{ {
Info<< type() << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
} }
if (phi.dimensions() == dimMass/dimTime) if (phi.dimensions() == dimMass/dimTime)
@ -281,7 +281,8 @@ void Foam::yPlusRAS::write()
if (log_) if (log_)
{ {
Info<< endl; Info<< " writing field " << yPlusRAS.name() << nl
<< endl;
} }
yPlusRAS.write(); yPlusRAS.write();

View File

@ -157,7 +157,7 @@ inline void Foam::constTransport<Thermo>::operator+=
scalar molr2 = st.nMoles()/this->nMoles(); scalar molr2 = st.nMoles()/this->nMoles();
mu_ = molr1*mu_ + molr2*st.mu_; mu_ = molr1*mu_ + molr2*st.mu_;
rPr_ = molr1*rPr_ + molr2*st.rPr_; rPr_ = 1.0/(molr1/rPr_ + molr2/st.rPr_);
} }
@ -175,7 +175,7 @@ inline void Foam::constTransport<Thermo>::operator-=
scalar molr2 = st.nMoles()/this->nMoles(); scalar molr2 = st.nMoles()/this->nMoles();
mu_ = molr1*mu_ - molr2*st.mu_; mu_ = molr1*mu_ - molr2*st.mu_;
rPr_ = molr1*rPr_ - molr2*st.rPr_; rPr_ = 1.0/(molr1/rPr_ - molr2/st.rPr_);
} }
@ -210,7 +210,7 @@ inline Foam::constTransport<Thermo> Foam::operator+
( (
t, t,
molr1*ct1.mu_ + molr2*ct2.mu_, molr1*ct1.mu_ + molr2*ct2.mu_,
molr1*ct1.rPr_ + molr2*ct2.rPr_ 1.0/(molr1/ct1.rPr_ + molr2/ct2.rPr_)
); );
} }
@ -234,7 +234,7 @@ inline Foam::constTransport<Thermo> Foam::operator-
( (
t, t,
molr1*ct1.mu_ - molr2*ct2.mu_, molr1*ct1.mu_ - molr2*ct2.mu_,
molr1*ct1.rPr_ - molr2*ct2.rPr_ 1.0/(molr1/ct1.rPr_ - molr2/ct2.rPr_)
); );
} }
@ -250,7 +250,7 @@ inline Foam::constTransport<Thermo> Foam::operator*
( (
s*static_cast<const Thermo&>(ct), s*static_cast<const Thermo&>(ct),
ct.mu_, ct.mu_,
ct.rPr_ 1.0/ct.rPr_
); );
} }

View File

@ -9,7 +9,7 @@ rm -r constant/triSurface/flange.stl.gz > /dev/null 2>&1
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -r constant/ccx constant/ccy constant/ccz > /dev/null 2>&1 rm -r constant/ccx constant/ccy constant/ccz > /dev/null 2>&1
rm -r constant/internalDelaunayVertices constant/targetCellSize > /dev/null 2>&1 rm -r constant/internalDelaunayVertices constant/targetCellSize > /dev/null 2>&1
rm -r 0/ccx 0/ccy 0/ccz > /dev/null 2>&1 rm -r 0 > /dev/null 2>&1
rm -rf constant/backgroundMeshDecomposition/polyMesh/boundary > /dev/null 2>&1 rm -rf constant/backgroundMeshDecomposition/polyMesh/boundary > /dev/null 2>&1
rm -rf constant/backgroundMeshDecomposition/polyMesh/faces > /dev/null 2>&1 rm -rf constant/backgroundMeshDecomposition/polyMesh/faces > /dev/null 2>&1

View File

@ -7,8 +7,12 @@ cd ${0%/*} || exit 1 # run from this directory
# copy flange surface from resources folder # copy flange surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/ cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
# Create tight-fitting background mesh cp system/controlDict system/controlDict.org
runApplication blockMesh
sed -e s/"\(endTime[ \t]*\)\([0-9]*\);"/"\1 10;"/g \
-e s/"\(writeInterval[ \t]*\)\([0-9]*\);"/"\1 10;"/g \
system/controlDict.org > system/controlDict
runApplication foamyHexMesh runApplication foamyHexMesh
# Change collapseEdges to only do one iteration # Change collapseEdges to only do one iteration
@ -19,5 +23,10 @@ system/collapseDict.org > system/collapseDict
runApplication collapseEdges -latestTime -collapseFaces runApplication collapseEdges -latestTime -collapseFaces
cp system/controlDict.org system/controlDict
cp system/collapseDict.org system/collapseDict
rm -f system/controlDict.org system/collapseDict.org
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -52,5 +52,6 @@ runParallel collapseEdges $nProcs -collapseFaces -latestTime
runParallel checkMesh $nProcs -latestTime -allTopology -allGeometry runParallel checkMesh $nProcs -latestTime -allTopology -allGeometry
runApplication reconstructParMesh -latestTime
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -22,16 +22,12 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type zeroGradient;
value $internalField;
} }
outlet outlet
{ {
type inletOutlet; type zeroGradient;
phi phi.particles;
inletValue $internalField;
value $internalField;
} }
walls walls

View File

@ -22,8 +22,10 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type interstitialInletVelocity;
value uniform (0 0.25 0); inletVelocity uniform (0 0.25 0);
alpha alpha.air;
value $internalField;
} }
outlet outlet

View File

@ -1,45 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
frontAndBackPlanes
{
type empty;
}
}
// ************************************************************************* //

View File

@ -22,8 +22,7 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type zeroGradient;
value uniform 0;
} }
outlet outlet