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

This commit is contained in:
graham
2011-03-03 11:19:57 +00:00
116 changed files with 278 additions and 221 deletions

View File

@ -191,6 +191,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
if (QrNbrName_ != "none") if (QrNbrName_ != "none")
{ {
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_); QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
mpp.map().distribute(QrNbr);
} }
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp); scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);

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) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,17 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
porousExplicitSourceReactingParcelFoam LTSReactingParcelFoam
Description Description
Transient PISO solver for compressible, laminar or turbulent flow with Local time stepping (LTS) solver for steady, compressible, laminar or
reacting multiphase Lagrangian parcels for porous media, including explicit turbulent reacting and non-reacting flow with multiphase Lagrangian
sources for mass, momentum and energy parcels and porous media, including explicit sources for mass, momentum
and energy
The solver includes:
- reacting multiphase parcel cloud
- porous media
- mass, momentum and energy sources
Note: ddtPhiCorr not used here when porous zones are active Note: ddtPhiCorr not used here when porous zones are active
- not well defined for porous calculations - not well defined for porous calculations
@ -75,7 +71,7 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readSIMPLEControls.H" #include "readPISOControls.H"
#include "readChemistryProperties.H" #include "readChemistryProperties.H"
#include "readAdditionalSolutionControls.H" #include "readAdditionalSolutionControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
@ -84,26 +80,24 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
p.storePrevIter(); parcels.evolve();
// --- Pressure-velocity corrector #include "chemistry.H"
#include "timeScales.H"
#include "rhoEqn.H"
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{ {
parcels.evolve();
#include "chemistry.H"
#include "timeScales.H"
#include "rhoEqn.H"
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
#include "pEqn.H" #include "pEqn.H"
turbulence->correct();
} }
turbulence->correct();
if (runTime.write()) if (runTime.write())
{ {
chemistry.dQ()().write(); chemistry.dQ()().write();

View File

@ -0,0 +1,3 @@
LTSReactingParcelFoam.C
EXE = $(FOAM_APPBIN)/LTSReactingParcelFoam

View File

@ -73,12 +73,12 @@
dimensionedScalar rhoMax dimensionedScalar rhoMax
( (
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax") mesh.solutionDict().subDict("PISO").lookup("rhoMax")
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin") mesh.solutionDict().subDict("PISO").lookup("rhoMin")
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;

View File

@ -48,9 +48,6 @@
} }
} }
// Explicitly relax pressure for momentum corrector
p.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl; Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
// Second part of thermodynamic density update // Second part of thermodynamic density update

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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

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) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -1,3 +0,0 @@
steadyReactingParcelFoam.C
EXE = $(FOAM_APPBIN)/steadyReactingParcelFoam

View File

@ -270,7 +270,7 @@ addLayersControls
//- If points get not extruded do nGrow layers of connected faces that are //- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process // also not grown. This helps convergence of the layer addition process
// close to features. // close to features.
// Note: changed(corrected) w.r.t 16x! (didn't do anything in 16x) // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
nGrow 0; nGrow 0;
@ -301,7 +301,7 @@ addLayersControls
maxThicknessToMedialRatio 0.3; maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points // Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 16x! 90 degrees corresponds to 130 in 16x. // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90; minMedianAxisAngle 90;
// Create buffer region for new layer terminations // Create buffer region for new layer terminations

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,18 +86,25 @@ void Foam::Time::adjustDeltaT()
(outputTimeIndex_ + 1)*writeInterval_ - (value() - startTime_) (outputTimeIndex_ + 1)*writeInterval_ - (value() - startTime_)
); );
label nStepsToNextWrite = label(timeToNextWrite/deltaT_ - SMALL) + 1; scalar nSteps = timeToNextWrite/deltaT_ - SMALL;
scalar newDeltaT = timeToNextWrite/nStepsToNextWrite;
// Control the increase of the time step to within a factor of 2 // For tiny deltaT the label can overflow!
// and the decrease within a factor of 5. if (nSteps < labelMax)
if (newDeltaT >= deltaT_)
{ {
deltaT_ = min(newDeltaT, 2.0*deltaT_); label nStepsToNextWrite = label(nSteps) + 1;
}
else scalar newDeltaT = timeToNextWrite/nStepsToNextWrite;
{
deltaT_ = max(newDeltaT, 0.2*deltaT_); // Control the increase of the time step to within a factor of 2
// and the decrease within a factor of 5.
if (newDeltaT >= deltaT_)
{
deltaT_ = min(newDeltaT, 2.0*deltaT_);
}
else
{
deltaT_ = max(newDeltaT, 0.2*deltaT_);
}
} }
} }
} }

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,9 +30,24 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::coupledPolyPatch, 0); namespace Foam
{
defineTypeNameAndDebug(coupledPolyPatch, 0);
Foam::scalar Foam::coupledPolyPatch::matchTol = 1E-3; scalar coupledPolyPatch::matchTol = 1E-3;
template<>
const char* NamedEnum<coupledPolyPatch::transformType, 4>::names[] =
{
"unknown",
"rotational",
"translational",
"noOrdering"
};
const NamedEnum<coupledPolyPatch::transformType, 4>
coupledPolyPatch::transformTypeNames;
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -204,12 +219,14 @@ void Foam::coupledPolyPatch::calcTransformTensors
const vectorField& nf, const vectorField& nf,
const vectorField& nr, const vectorField& nr,
const scalarField& smallDist, const scalarField& smallDist,
const scalar absTol const scalar absTol,
const transformType transform
) const ) const
{ {
if (debug) if (debug)
{ {
Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl
<< " transform:" << transformTypeNames[transform] << nl
<< " (half)size:" << Cf.size() << nl << " (half)size:" << Cf.size() << nl
<< " absTol:" << absTol << nl << " absTol:" << absTol << nl
<< " smallDist min:" << min(smallDist) << nl << " smallDist min:" << min(smallDist) << nl
@ -242,9 +259,16 @@ void Foam::coupledPolyPatch::calcTransformTensors
Pout<< " error:" << error << endl; Pout<< " error:" << error << endl;
} }
if (sum(mag(nf & nr)) < Cf.size()-error) if
(
transform == ROTATIONAL
|| (
transform != TRANSLATIONAL
&& (sum(mag(nf & nr)) < Cf.size()-error)
)
)
{ {
// Rotation, no separation // Type is rotation or unknown and normals not aligned
// Assume per-face differing transformation, correct later // Assume per-face differing transformation, correct later
@ -284,7 +308,7 @@ void Foam::coupledPolyPatch::calcTransformTensors
} }
else else
{ {
// No rotation, possible separation // Translational or (unknown and normals aligned)
forwardT_.setSize(0); forwardT_.setSize(0);
reverseT_.setSize(0); reverseT_.setSize(0);

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,6 +53,20 @@ class coupledPolyPatch
: :
public polyPatch public polyPatch
{ {
public:
enum transformType
{
UNKNOWN, // unspecified; automatic ordering
ROTATIONAL, // rotation along coordinate axis
TRANSLATIONAL, // translation
NOORDERING // unspecified, no automatic ordering
};
static const NamedEnum<transformType, 4> transformTypeNames;
private:
// Private data // Private data
//- offset (distance) vector from one side of the couple to the other //- offset (distance) vector from one side of the couple to the other
@ -82,6 +96,8 @@ protected:
//- Calculate the transformation tensors //- Calculate the transformation tensors
// smallDist : matching distance per face // smallDist : matching distance per face
// absTol : absolute error in normal // absTol : absolute error in normal
// if transformType = unknown it first tries rotational, then
// translational transform
void calcTransformTensors void calcTransformTensors
( (
const vectorField& Cf, const vectorField& Cf,
@ -89,7 +105,8 @@ protected:
const vectorField& nf, const vectorField& nf,
const vectorField& nr, const vectorField& nr,
const scalarField& smallDist, const scalarField& smallDist,
const scalar absTol = matchTol const scalar absTol = matchTol,
const transformType = UNKNOWN
) const; ) const;
//- Initialise the calculation of the patch geometry //- Initialise the calculation of the patch geometry

View File

@ -44,24 +44,8 @@ namespace Foam
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word); addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary); addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary);
template<>
const char* Foam::NamedEnum
<
Foam::cyclicPolyPatch::transformType,
4
>::names[] =
{
"unknown",
"rotational",
"translational",
"noOrdering"
};
} }
const Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4>
Foam::cyclicPolyPatch::transformTypeNames;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -271,7 +255,9 @@ void Foam::cyclicPolyPatch::calcTransforms
static_cast<const pointField&>(half1Ctrs), static_cast<const pointField&>(half1Ctrs),
half0Normals, half0Normals,
half1Normals, half1Normals,
half0Tols half0Tols,
matchTol,
transform_
); );
if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1) if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1)

View File

@ -64,20 +64,6 @@ class cyclicPolyPatch
: :
public coupledPolyPatch public coupledPolyPatch
{ {
public:
enum transformType
{
UNKNOWN, // unspecified; automatic ordering
ROTATIONAL, // rotation along coordinate axis
TRANSLATIONAL, // translation
NOORDERING // unspecified, no automatic ordering
};
static const NamedEnum<transformType, 4> transformTypeNames;
private:
// Private data // Private data
//- Name of other half //- Name of other half

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Analytical.H" #include "Analytical.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -59,9 +58,9 @@ template<class Type>
typename Foam::IntegrationScheme<Type>::integrationResult typename Foam::IntegrationScheme<Type>::integrationResult
Foam::Analytical<Type>::integrate Foam::Analytical<Type>::integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const ) const
{ {
@ -69,9 +68,18 @@ Foam::Analytical<Type>::integrate
const scalar expTerm = exp(min(50, -beta*dt)); const scalar expTerm = exp(min(50, -beta*dt));
retValue.average() = if (beta > ROOTVSMALL)
alpha + (phi - alpha)*(1 - expTerm)/(beta*dt + ROOTVSMALL); {
retValue.value() = alpha + (phi - alpha)*expTerm; const Type alpha = alphaBeta/beta;
retValue.average() = alpha + (phi - alpha)*(1 - expTerm)/(beta*dt);
retValue.value() = alpha + (phi - alpha)*expTerm;
}
else
{
retValue.average() = phi;
retValue.value() = phi;
}
return retValue; return retValue;
} }

View File

@ -81,9 +81,9 @@ public:
//- Perform the integration //- Perform the integration
virtual typename IntegrationScheme<Type>::integrationResult integrate virtual typename IntegrationScheme<Type>::integrationResult integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const; ) const;
}; };

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Euler.H" #include "Euler.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -59,14 +58,14 @@ template<class Type>
typename Foam::IntegrationScheme<Type>::integrationResult typename Foam::IntegrationScheme<Type>::integrationResult
Foam::Euler<Type>::integrate Foam::Euler<Type>::integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const ) const
{ {
typename IntegrationScheme<Type>::integrationResult retValue; typename IntegrationScheme<Type>::integrationResult retValue;
retValue.value() = (phi + beta*dt*alpha)/(1.0 + beta*dt); retValue.value() = (phi + alphaBeta*dt)/(1.0 + beta*dt);
retValue.average() = 0.5*(phi + retValue.value()); retValue.average() = 0.5*(phi + retValue.value());
return retValue; return retValue;

View File

@ -78,9 +78,9 @@ public:
//- Perform the integration //- Perform the integration
virtual typename IntegrationScheme<Type>::integrationResult integrate virtual typename IntegrationScheme<Type>::integrationResult integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const; ) const;
}; };

View File

@ -60,9 +60,9 @@ template<class Type>
typename Foam::IntegrationScheme<Type>::integrationResult typename Foam::IntegrationScheme<Type>::integrationResult
Foam::IntegrationScheme<Type>::integrate Foam::IntegrationScheme<Type>::integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const ) const
{ {
@ -71,9 +71,9 @@ Foam::IntegrationScheme<Type>::integrate
"Foam::IntegrationScheme<Type>::integrationResult" "Foam::IntegrationScheme<Type>::integrationResult"
"Foam::IntegrationScheme<Type>::integrate" "Foam::IntegrationScheme<Type>::integrate"
"(" "("
"const Type, " "const Type&, "
"const scalar, " "const scalar, "
"const Type, " "const Type&, "
"const scalar" "const scalar"
") const" ") const"
); );

View File

@ -183,9 +183,9 @@ public:
//- Perform the Integration //- Perform the Integration
virtual integrationResult integrate virtual integrationResult integrate
( (
const Type phi, const Type& phi,
const scalar dt, const scalar dt,
const Type alpha, const Type& alphaBeta,
const scalar beta const scalar beta
) const; ) const;
}; };

View File

@ -114,11 +114,11 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
if (this->solution().active()) if (this->solution().active())
{ {
setModels(); setModels();
}
if (readFields) if (readFields)
{ {
parcelType::readFields(*this); parcelType::readFields(*this);
}
} }
} }

View File

@ -360,11 +360,11 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
if (solution_.active()) if (solution_.active())
{ {
setModels(); setModels();
}
if (readFields) if (readFields)
{ {
parcelType::readFields(*this); parcelType::readFields(*this);
}
} }
if (solution_.resetSourcesOnStartup()) if (solution_.resetSourcesOnStartup())
@ -504,7 +504,7 @@ void Foam::KinematicCloud<CloudType>::checkParcelProperties
parcel.rho() = constProps_.rho0(); parcel.rho() = constProps_.rho0();
} }
const scalar carrierDt = this->db().time().deltaTValue(); const scalar carrierDt = solution_.deltaT();
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt; parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
parcel.typeId() = constProps_.parcelTypeId(); parcel.typeId() = constProps_.parcelTypeId();
} }

View File

@ -374,16 +374,38 @@ Foam::KinematicCloud<CloudType>::theta() const
) )
); );
scalarField& theta = ttheta().internalField(); volScalarField& theta = ttheta();
theta.boundaryField() == 0;
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{ {
const parcelType& p = iter(); const parcelType& p = iter();
const label cellI = p.cell(); const label cellI = p.cell();
if ((p.face() != -1))
{
const label patchI = p.patch(p.face());
if (patchI != -1)
{
scalarField& thetap = theta.boundaryField()[patchI];
const label faceI = p.patchFace(patchI, p.face());
thetap[faceI] += p.nParticle()*p.areaP();
}
}
theta[cellI] += p.nParticle()*p.volume(); theta[cellI] += p.nParticle()*p.volume();
} }
theta /= mesh().V(); theta.internalField() /= mesh_.V();
forAll(theta.boundaryField(), patchI)
{
scalarField& thetap = theta.boundaryField()[patchI];
if (thetap.size() > 0)
{
thetap /= mesh_.magSf().boundaryField()[patchI];
}
}
return ttheta; return ttheta;
} }
@ -420,7 +442,7 @@ Foam::KinematicCloud<CloudType>::alpha() const
alpha[cellI] += p.nParticle()*p.mass(); alpha[cellI] += p.nParticle()*p.mass();
} }
alpha /= (mesh().V()*rho_); alpha /= (mesh_.V()*rho_);
return talpha; return talpha;
} }
@ -457,7 +479,7 @@ Foam::KinematicCloud<CloudType>::rhoEff() const
rhoEff[cellI] += p.nParticle()*p.mass(); rhoEff[cellI] += p.nParticle()*p.mass();
} }
rhoEff /= mesh().V(); rhoEff /= mesh_.V();
return trhoEff; return trhoEff;
} }

View File

@ -117,6 +117,11 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
if (this->solution().active()) if (this->solution().active())
{ {
setModels(); setModels();
if (readFields)
{
parcelType::readFields(*this, this->composition());
}
} }
// Set storage for mass source fields and initialise to zero // Set storage for mass source fields and initialise to zero
@ -142,11 +147,6 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
); );
} }
if (readFields)
{
parcelType::readFields(*this, this->composition());
}
if (this->solution().resetSourcesOnStartup()) if (this->solution().resetSourcesOnStartup())
{ {
resetSourceTerms(); resetSourceTerms();

View File

@ -94,11 +94,11 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
if (this->solution().active()) if (this->solution().active())
{ {
setModels(); setModels();
}
if (readFields) if (readFields)
{ {
parcelType::readFields(*this, this->composition()); parcelType::readFields(*this, this->composition());
}
} }
if (this->solution().resetSourcesOnStartup()) if (this->solution().resetSourcesOnStartup())

View File

@ -135,11 +135,11 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
if (this->solution().active()) if (this->solution().active())
{ {
setModels(); setModels();
}
if (readFields) if (readFields)
{ {
parcelType::readFields(*this); parcelType::readFields(*this);
}
} }
if (this->solution().resetSourcesOnStartup()) if (this->solution().resetSourcesOnStartup())

View File

@ -192,21 +192,20 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
const parcelType& p = static_cast<const parcelType&>(*this); const parcelType& p = static_cast<const parcelType&>(*this);
const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu); const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu);
const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu); const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu);
forceSuSp Feff = Fcp + Fncp; const forceSuSp Feff = Fcp + Fncp;
Feff.Sp() += ROOTVSMALL;
// New particle velocity // New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D // Update velocity - treat as 3-D
const vector ap = Uc_ + (Feff.Su() + Su)/Feff.Sp(); const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/mass;
const scalar bp = Feff.Sp()/mass; const scalar bp = Feff.Sp()/mass;
Spu = Feff.Sp(); Spu = Feff.Sp()*dt/td.cloud().solution().deltaT();
IntegrationScheme<vector>::integrationResult Ures = IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U, dt, ap, bp); td.cloud().UIntegrator().integrate(U, dt, abp, bp);
vector Unew = Ures.value(); vector Unew = Ures.value();

View File

@ -333,13 +333,13 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
// Integrate to find the new parcel temperature // Integrate to find the new parcel temperature
IntegrationScheme<scalar>::integrationResult Tres = IntegrationScheme<scalar>::integrationResult Tres =
td.cloud().TIntegrator().integrate(T, dt, ap, bp); td.cloud().TIntegrator().integrate(T, dt, ap*bp, bp);
scalar Tnew = max(Tres.value(), td.cloud().constProps().TMin()); scalar Tnew = max(Tres.value(), td.cloud().constProps().TMin());
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_); dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
Cuh = bp; Cuh = bp*dt/td.cloud().solution().deltaT();
return Tnew; return Tnew;
} }

View File

@ -520,7 +520,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
} }
const scalar time = this->owner().db().time().value(); const scalar time = this->owner().db().time().value();
const scalar carrierDt = this->owner().db().time().deltaTValue(); const scalar carrierDt = this->owner().solution().deltaT();
const polyMesh& mesh = this->owner().mesh(); const polyMesh& mesh = this->owner().mesh();
// Prepare for next time step // Prepare for next time step

View File

@ -290,7 +290,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
} }
else else
{ {
Up = (Cf - Cf00)/mesh.time().deltaTValue(); Up = (Cf - Cf00)/this->owner().solution().deltaT();
} }
if (mag(dn) > SMALL) if (mag(dn) > SMALL)
@ -312,7 +312,9 @@ void Foam::PatchInteractionModel<CloudType>::patchData
// magOmega = sin(angle between unit normals) // magOmega = sin(angle between unit normals)
// Normalise omega vector by magOmega, then multiply by // Normalise omega vector by magOmega, then multiply by
// angle/dt to give the correct angular velocity vector. // angle/dt to give the correct angular velocity vector.
omega *= Foam::asin(magOmega)/(magOmega*mesh.time().deltaTValue()); omega *=
Foam::asin(magOmega)
/(magOmega*this->owner().solution().deltaT());
// Project position onto face and calculate this position // Project position onto face and calculate this position
// relative to the face centre. // relative to the face centre.

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) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -709,16 +709,17 @@ Foam::directMappedPatchBase::directMappedPatchBase
} }
else else
{ {
FatalErrorIn FatalIOErrorIn
( (
"directMappedPatchBase::directMappedPatchBase\n" "directMappedPatchBase::directMappedPatchBase\n"
"(\n" "(\n"
" const polyPatch& pp,\n" " const polyPatch& pp,\n"
" const dictionary& dict\n" " const dictionary& dict\n"
")\n" ")\n",
dict
) << "Please supply the offsetMode as one of " ) << "Please supply the offsetMode as one of "
<< NamedEnum<offsetMode, 3>::words() << NamedEnum<offsetMode, 3>::words()
<< exit(FatalError); << exit(FatalIOError);
} }
} }

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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,23 +53,15 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
{ {
const vector& sample = operator[](probeI); const vector& sample = operator[](probeI);
label faceI = meshSearchEngine.findNearestBoundaryFace(sample); label faceI = meshSearchEngine.findNearestBoundaryFace(sample);
if (faceI == -1) const point& fc = mesh.faceCentres()[faceI];
{ nearest[probeI].first() = pointIndexHit
nearest[probeI].second().first() = Foam::sqr(GREAT); (
nearest[probeI].second().second() = Pstream::myProcNo(); true,
} fc,
else faceI
{ );
const point& fc = mesh.faceCentres()[faceI]; nearest[probeI].second().first() = magSqr(fc-sample);
nearest[probeI].first() = pointIndexHit nearest[probeI].second().second() = Pstream::myProcNo();
(
true,
fc,
faceI
);
nearest[probeI].second().first() = magSqr(fc-sample);
nearest[probeI].second().second() = Pstream::myProcNo();
}
} }
@ -92,27 +84,16 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
} }
} }
// Check if all patchProbes have been found. // Check if all patchProbes have been found.
forAll(nearest, sampleI) forAll(nearest, sampleI)
{ {
label localI = nearest[sampleI].first().index(); label localI = -1;
if (nearest[sampleI].second().second() == Pstream::myProcNo())
{
localI = nearest[sampleI].first().index();
}
if (localI == -1) elementList_[sampleI] = localI;
{
if (Pstream::master())
{
WarningIn("patchProbes::findElements()")
<< "Did not find location "
<< nearest[sampleI].second().first()
<< " in any cell. Skipping location." << endl;
}
}
else
{
elementList_[sampleI] = localI;
}
} }
} }

View File

@ -81,17 +81,18 @@ Foam::radiationCoupledBase::radiationCoupledBase
{ {
if (!isA<directMappedPatchBase>(patch_.patch())) if (!isA<directMappedPatchBase>(patch_.patch()))
{ {
FatalErrorIn FatalIOErrorIn
( (
"radiationCoupledBase::radiationCoupledBase\n" "radiationCoupledBase::radiationCoupledBase\n"
"(\n" "(\n"
" const fvPatch& p,\n" " const fvPatch& p,\n"
" const dictionary& dict\n" " const dictionary& dict\n"
")\n" ")\n",
dict
) << "\n patch type '" << patch_.type() ) << "\n patch type '" << patch_.type()
<< "' not type '" << directMappedPatchBase::typeName << "'" << "' not type '" << directMappedPatchBase::typeName << "'"
<< "\n for patch " << patch_.name() << "\n for patch " << patch_.name()
<< exit(FatalError); << exit(FatalIOError);
} }
emissivity_ = scalarField(patch_.size(), 0.0); emissivity_ = scalarField(patch_.size(), 0.0);
@ -102,16 +103,17 @@ Foam::radiationCoupledBase::radiationCoupledBase
{ {
if(!dict.found("emissivity")) if(!dict.found("emissivity"))
{ {
FatalErrorIn FatalIOErrorIn
( (
"radiationCoupledBase::radiationCoupledBase\n" "radiationCoupledBase::radiationCoupledBase\n"
"(\n" "(\n"
" const fvPatch& p,\n" " const fvPatch& p,\n"
" const dictionary& dict\n" " const dictionary& dict\n"
")\n" ")\n",
dict
) << "\n emissivity key does not exist for patch " ) << "\n emissivity key does not exist for patch "
<< patch_.name() << patch_.name()
<< exit(FatalError); << exit(FatalIOError);
} }
else else
{ {

View File

@ -70,45 +70,80 @@ edges
arc 23 19 ( 0.034 0.094 2.000 ) arc 23 19 ( 0.034 0.094 2.000 )
); );
patches boundary
( (
patch inlet inlet
( {
type patch;
faces
(
(13 12 21 16) (13 12 21 16)
(14 13 16 18) (14 13 16 18)
(15 14 18 20) (15 14 18 20)
(17 22 12 13) (17 22 12 13)
(23 19 14 15) (23 19 14 15)
) );
patch outlet }
( outlet
{
type patch;
faces
(
(1 4 9 0) (1 4 9 0)
(2 6 4 1) (2 6 4 1)
(3 8 6 2) (3 8 6 2)
(5 1 0 10) (5 1 0 10)
(11 3 2 7) (11 3 2 7)
) );
wall innerWall }
( innerWall
{
type wall;
faces
(
(2 1 13 14) (2 1 13 14)
(5 10 22 17) (5 10 22 17)
(5 17 13 1) (5 17 13 1)
(11 7 19 23) (11 7 19 23)
(7 2 14 19) (7 2 14 19)
) );
wall outerWall }
( outerWall
{
type wall;
faces
(
(4 16 21 9) (4 16 21 9)
(6 18 16 4) (6 18 16 4)
(8 20 18 6) (8 20 18 6)
) );
cyclic cyclic }
( cyclic_half0
{
type cyclic;
neighbourPatch cyclic_half1;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
faces
(
(0 9 21 12) (0 9 21 12)
(10 0 12 22) (10 0 12 22)
);
}
cyclic_half1
{
type cyclic;
neighbourPatch cyclic_half0;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
faces
(
(3 15 20 8) (3 15 20 8)
(11 23 15 3) (11 23 15 3)
) );
}
); );
mergeMatchPairs mergeMatchPairs

View File

@ -8,4 +8,4 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh runApplication blockMesh
# run the solver # run the solver
runApplication steadyReactingParcelFoam runApplication LTSReactingParcelFoam

View File

@ -51,4 +51,8 @@ maxCo 0.5;
maxDeltaT 1; maxDeltaT 1;
alphaTauSpecie 1e10;
alphaTauTemp 0.005;
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,8 +53,9 @@ solvers
} }
} }
SIMPLE PISO
{ {
nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
momentumPredictor yes; momentumPredictor yes;
rhoMin rhoMin [1 -3 0 0 0] 0.1; rhoMin rhoMin [1 -3 0 0 0] 0.1;
@ -68,10 +69,5 @@ additional
solveSpecies true; solveSpecies true;
} }
relaxationFactors
{
p 0.3;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -8,6 +8,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh runApplication blockMesh
# run the solver # run the solver
runApplication steadyReactingParcelFoam runApplication LTSReactingParcelFoam
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

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