MRG: Integrated Foundation code to commit ba4dbed

This commit is contained in:
Andrew Heather
2017-03-23 12:11:49 +00:00
157 changed files with 1051 additions and 1718 deletions

View File

@ -54,4 +54,3 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
T.write();
}

View File

@ -3,4 +3,3 @@ if (adjustTimeStep)
runTime.setDeltaT(min(dtChem, maxDeltaT));
Info<< "deltaT = " << runTime.deltaT().value() << endl;
}

View File

@ -1,4 +1,3 @@
const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO");
const int nBcorr = Bpiso.lookupOrDefault<int>("nCorrectors", 1);

View File

@ -2,4 +2,3 @@
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);

View File

@ -182,6 +182,11 @@
if (alphaApplyPrevCorr && MULESCorr)
{
talphaPhiCorr0 = alphaPhi - talphaPhiCorr0;
talphaPhiCorr0.ref().rename("alphaPhiCorr0");
}
else
{
talphaPhiCorr0.clear();
}
if

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,6 +128,9 @@ int main(int argc, char *argv[])
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
// Do not apply previous time-step mesh compression flux
talphaPhiCorr0.clear();
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,11 +64,8 @@ void Foam::multiphaseSystem::solveAlphas()
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
{
phaseModel& phase1 = iter();
volScalarField& alpha1 = phase1;
phase1.alphaPhi() =
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
phaseModel& phase = iter();
volScalarField& alpha1 = phase;
alphaPhiCorrs.set
(
@ -79,7 +76,7 @@ void Foam::multiphaseSystem::solveAlphas()
fvc::flux
(
phi_,
phase1,
phase,
"div(phi," + alpha1.name() + ')'
)
)
@ -92,13 +89,13 @@ void Foam::multiphaseSystem::solveAlphas()
phaseModel& phase2 = iter2();
volScalarField& alpha2 = phase2;
if (&phase2 == &phase1) continue;
if (&phase2 == &phase) continue;
surfaceScalarField phir(phase1.phi() - phase2.phi());
surfaceScalarField phir(phase.phi() - phase2.phi());
scalarCoeffSymmTable::const_iterator cAlpha
(
cAlphas_.find(interfacePair(phase1, phase2))
cAlphas_.find(interfacePair(phase, phase2))
);
if (cAlpha != cAlphas_.end())
@ -108,7 +105,7 @@ void Foam::multiphaseSystem::solveAlphas()
(mag(phi_) + mag(phir))/mesh_.magSf()
);
phir += min(cAlpha()*phic, max(phic))*nHatf(phase1, phase2);
phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2);
}
word phirScheme
@ -119,39 +116,18 @@ void Foam::multiphaseSystem::solveAlphas()
alphaPhiCorr += fvc::flux
(
-fvc::flux(-phir, phase2, phirScheme),
phase1,
phase,
phirScheme
);
}
surfaceScalarField::Boundary& alphaPhiCorrBf =
alphaPhiCorr.boundaryFieldRef();
// Ensure that the flux at inflow BCs is preserved
forAll(alphaPhiCorrBf, patchi)
{
fvsPatchScalarField& alphaPhiCorrp = alphaPhiCorrBf[patchi];
if (!alphaPhiCorrp.coupled())
{
const scalarField& phi1p = phase1.phi().boundaryField()[patchi];
const scalarField& alpha1p = alpha1.boundaryField()[patchi];
forAll(alphaPhiCorrp, facei)
{
if (phi1p[facei] < 0)
{
alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei];
}
}
}
}
phase.correctInflowOutflow(alphaPhiCorr);
MULES::limit
(
1.0/mesh_.time().deltaT().value(),
geometricOneField(),
phase1,
phase,
phi_,
alphaPhiCorr,
zeroField(),
@ -182,29 +158,30 @@ void Foam::multiphaseSystem::solveAlphas()
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
{
phaseModel& phase1 = iter();
phaseModel& phase = iter();
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase1);
alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
phase.correctInflowOutflow(alphaPhi);
MULES::explicitSolve
(
geometricOneField(),
phase1,
phase,
alphaPhi,
zeroField(),
zeroField()
);
phase1.alphaPhi() += alphaPhi;
phase.alphaPhi() = alphaPhi;
Info<< phase1.name() << " volume fraction, min, max = "
<< phase1.weightedAverage(mesh_.V()).value()
<< ' ' << min(phase1).value()
<< ' ' << max(phase1).value()
Info<< phase.name() << " volume fraction, min, max = "
<< phase.weightedAverage(mesh_.V()).value()
<< ' ' << min(phase).value()
<< ' ' << max(phase).value()
<< endl;
sumAlpha += phase1;
sumAlpha += phase;
phasei++;
}
@ -215,6 +192,15 @@ void Foam::multiphaseSystem::solveAlphas()
<< ' ' << max(sumAlpha).value()
<< endl;
// Correct the sum of the phase-fractions to avoid 'drift'
volScalarField sumCorr(1.0 - sumAlpha);
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
{
phaseModel& phase = iter();
volScalarField& alpha = phase;
alpha += alpha*sumCorr;
}
calcAlphas();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -236,6 +236,24 @@ bool Foam::phaseModel::read(const dictionary& phaseDict)
}
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
const volScalarField::Boundary& alphaBf = boundaryField();
const surfaceScalarField::Boundary& phiBf = phi().boundaryField();
forAll(alphaPhiBf, patchi)
{
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
if (!alphaPhip.coupled())
{
alphaPhip = phiBf[patchi]*alphaBf[patchi];
}
}
}
Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const
{
return dPtr_().d();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -208,6 +208,9 @@ public:
return alphaPhi_;
}
//- Ensure that the flux at inflow/outflow BCs is preserved
void correctInflowOutflow(surfaceScalarField& alphaPhi) const;
//- Correct the phase properties
void correct();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -681,6 +681,14 @@ void Foam::multiphaseMixture::solveAlphas
<< ' ' << max(sumAlpha).value()
<< endl;
// Correct the sum of the phase-fractions to avoid 'drift'
volScalarField sumCorr(1.0 - sumAlpha);
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase& alpha = iter();
alpha += alpha*sumCorr;
}
calcAlphas();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,9 +86,7 @@ Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::update
(
const volScalarField& Tf
)
{
// do nothing
}
{}
template<class Thermo, class OtherThermo>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -375,6 +375,18 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
volScalarField hef1(phase1.thermo().he(phase1.thermo().p(), Tf));
volScalarField hef2(phase2.thermo().he(phase2.thermo().p(), Tf));
volScalarField L
(
min
(
(pos(iDmdt)*he2 + neg(iDmdt)*hef2)
- (neg(iDmdt)*he1 + pos(iDmdt)*hef1),
0.3*mag(hef2 - hef1)
)
);
volScalarField iDmdtNew(iDmdt);
if (massTransfer_ )
{
volScalarField H1
@ -389,28 +401,13 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
Tf = saturationModel_->Tsat(phase1.thermo().p());
scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt"));
iDmdtNew =
(H1*(Tf - T1) + H2*(Tf - T2))/L;
iDmdt =
(1 - iDmdtRelax)*iDmdt
+ iDmdtRelax*(H1*(Tf - T1) + H2*(Tf - T2))
/min
(
(pos(iDmdt)*he2 + neg(iDmdt)*hef2)
- (neg(iDmdt)*he1 + pos(iDmdt)*hef1),
0.3*mag(hef2 - hef1)
);
Info<< "iDmdt." << pair.name()
<< ": min = " << min(iDmdt.primitiveField())
<< ", mean = " << average(iDmdt.primitiveField())
<< ", max = " << max(iDmdt.primitiveField())
<< ", integral = " << fvc::domainIntegrate(iDmdt).value()
<< endl;
}
else
{
iDmdt == dimensionedScalar("0", dmdt.dimensions(), 0);
iDmdtNew == dimensionedScalar("0",dmdt.dimensions(), 0);
}
volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K());
@ -423,16 +420,7 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
H2.boundaryFieldRef() =
max(H2.boundaryField(), phase2.boundaryField()*HLimit);
volScalarField mDotL
(
iDmdt*
(
(pos(iDmdt)*he2 + neg(iDmdt)*hef2)
- (neg(iDmdt)*he1 + pos(iDmdt)*hef1)
)
);
Tf = (H1*T1 + H2*T2 + mDotL)/(H1 + H2);
Tf = (H1*T1 + H2*T2 + iDmdtNew*L)/(H1 + H2);
Info<< "Tf." << pair.name()
<< ": min = " << min(Tf.primitiveField())
@ -440,6 +428,19 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
<< ", max = " << max(Tf.primitiveField())
<< endl;
scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt"));
iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew;
if (massTransfer_ )
{
Info<< "iDmdt." << pair.name()
<< ": min = " << min(iDmdt.primitiveField())
<< ", mean = " << average(iDmdt.primitiveField())
<< ", max = " << max(iDmdt.primitiveField())
<< ", integral = " << fvc::domainIntegrate(iDmdt).value()
<< endl;
}
// Accumulate dmdt contributions from boundaries
volScalarField wDmdt
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -165,6 +165,24 @@ bool Foam::phaseModel::compressible() const
}
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
const volScalarField::Boundary& alphaBf = boundaryField();
const surfaceScalarField::Boundary& phiBf = phi()().boundaryField();
forAll(alphaPhiBf, patchi)
{
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
if (!alphaPhip.coupled())
{
alphaPhip = phiBf[patchi]*alphaBf[patchi];
}
}
}
const Foam::tmp<Foam::volScalarField>& Foam::phaseModel::divU() const
{
NotImplemented;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -283,6 +283,9 @@ public:
//- Access the mass flux of the phase
virtual surfaceScalarField& alphaRhoPhi() = 0;
//- Ensure that the flux at inflow/outflow BCs is preserved
void correctInflowOutflow(surfaceScalarField& alphaPhi) const;
// Transport

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,9 +76,7 @@ void Foam::phaseSystem::generatePairs
// pair already exists
if (phasePairs_.found(key))
{
// do nothing ...
}
{}
// new ordered pair
else if (key.ordered())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,15 +71,17 @@ void Foam::multiphaseSystem::solveAlphas()
{
bool LTS = fv::localEulerDdt::enabled(mesh_);
forAll(phases(), phasei)
{
phases()[phasei].correctBoundaryConditions();
}
PtrList<surfaceScalarField> alphaPhiCorrs(phases().size());
forAll(phases(), phasei)
{
phaseModel& phase = phases()[phasei];
volScalarField& alpha1 = phase;
phase.alphaPhi() =
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
alphaPhiCorrs.set
(
phasei,
@ -134,28 +136,7 @@ void Foam::multiphaseSystem::solveAlphas()
);
}
surfaceScalarField::Boundary& alphaPhiCorrBf =
alphaPhiCorr.boundaryFieldRef();
// Ensure that the flux at inflow BCs is preserved
forAll(alphaPhiCorr.boundaryField(), patchi)
{
fvsPatchScalarField& alphaPhiCorrp = alphaPhiCorrBf[patchi];
if (!alphaPhiCorrp.coupled())
{
const scalarField& phi1p = phase.phi().boundaryField()[patchi];
const scalarField& alpha1p = alpha1.boundaryField()[patchi];
forAll(alphaPhiCorrp, facei)
{
if (phi1p[facei] < 0)
{
alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei];
}
}
}
}
phase.correctInflowOutflow(alphaPhiCorr);
if (LTS)
{
@ -215,8 +196,9 @@ void Foam::multiphaseSystem::solveAlphas()
phaseModel& phase = phases()[phasei];
volScalarField& alpha = phase;
surfaceScalarField& alphaPhic = alphaPhiCorrs[phasei];
alphaPhic += upwind<scalar>(mesh_, phi_).flux(phase);
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
phase.correctInflowOutflow(alphaPhi);
volScalarField::Internal Sp
(
@ -298,12 +280,12 @@ void Foam::multiphaseSystem::solveAlphas()
(
geometricOneField(),
alpha,
alphaPhic,
alphaPhi,
Sp,
Su
);
phase.alphaPhi() += alphaPhic;
phase.alphaPhi() = alphaPhi;
Info<< phase.name() << " volume fraction, min, max = "
<< phase.weightedAverage(mesh_.V()).value()
@ -319,6 +301,14 @@ void Foam::multiphaseSystem::solveAlphas()
<< ' ' << min(sumAlpha).value()
<< ' ' << max(sumAlpha).value()
<< endl;
// Correct the sum of the phase-fractions to avoid 'drift'
volScalarField sumCorr(1.0 - sumAlpha);
forAll(phases(), phasei)
{
volScalarField& alpha = phases()[phasei];
alpha += alpha*sumCorr;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,9 @@ License
#include "saturationModel.H"
#include "wallFvPatch.H"
#include "uniformDimensionedFields.H"
#include "mathematicalConstants.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -157,6 +159,12 @@ alphatWallBoilingWallFunctionFvPatchScalarField
(
dict.subDict("departureFreqModel")
);
if (dict.found("dDep"))
{
dDep_ = scalarField("dDep", dict, p.size());
}
break;
}
}
@ -259,10 +267,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
// Lookup the fluid model
const ThermalPhaseChangePhaseSystem
<
MomentumTransferPhaseSystem
<
twoPhaseSystem>
>& fluid = refCast
MomentumTransferPhaseSystem<twoPhaseSystem>
>& fluid =
refCast
<
const ThermalPhaseChangePhaseSystem
<
@ -477,9 +484,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField Ja(rhoLiquidw*Cpw*Tsub/(rhoVaporw*L));
const scalarField Al(fLiquid*4.8*exp(-Ja/80));
const scalarField A2(min(M_PI*sqr(dDep_)*N*Al/4, scalar(1)));
const scalarField A2(min(pi*sqr(dDep_)*N*Al/4, scalar(1)));
const scalarField A1(max(1 - A2, scalar(1e-4)));
const scalarField A2E(min(M_PI*sqr(dDep_)*N*Al/4, scalar(5)));
const scalarField A2E(min(pi*sqr(dDep_)*N*Al/4, scalar(5)));
// Wall evaporation heat flux [kg/s3 = J/m2s]
const scalarField Qe((1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*L);
@ -495,7 +502,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
// Quenching heat transfer coefficient
const scalarField hQ
(
2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(M_PI*alphaw/rhow))
2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(pi*alphaw/rhow))
);
// Quenching heat flux
@ -622,11 +629,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
departureFreqModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl;
break;
}
}
dmdt_.writeEntry("dmdt", os);
dDep_.writeEntry("dDep", os);
alphatConv_.writeEntry("alphatConv", os);
writeEntry("value", os);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -269,7 +269,7 @@ public:
// Member functions
//- Calculate and return the departure diameter field
//- Return the departure diameter field
const scalarField& dDeparture() const
{
return dDep_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -201,7 +201,6 @@ void Foam::twoPhaseSystem::solve()
word alphaScheme("div(phi," + alpha1.name() + ')');
word alpharScheme("div(phir," + alpha1.name() + ')');
const surfaceScalarField& phi = this->phi();
const surfaceScalarField& phi1 = phase1_.phi();
const surfaceScalarField& phi2 = phase2_.phi();
@ -236,9 +235,7 @@ void Foam::twoPhaseSystem::solve()
}
alpha1.correctBoundaryConditions();
surfaceScalarField alpha1f(fvc::interpolate(max(alpha1, scalar(0))));
surfaceScalarField phic("phic", phi);
surfaceScalarField phir("phir", phi1 - phi2);
tmp<surfaceScalarField> alphaDbyA;
@ -279,7 +276,7 @@ void Foam::twoPhaseSystem::solve()
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
fvc::div(phi)*min(alpha1, scalar(1))
fvc::div(phi_)*min(alpha1, scalar(1))
);
if (tdgdt.valid())
@ -300,11 +297,11 @@ void Foam::twoPhaseSystem::solve()
}
}
surfaceScalarField alphaPhic1
surfaceScalarField alphaPhi1
(
fvc::flux
(
phic,
phi_,
alpha1,
alphaScheme
)
@ -316,28 +313,7 @@ void Foam::twoPhaseSystem::solve()
)
);
surfaceScalarField::Boundary& alphaPhic1Bf =
alphaPhic1.boundaryFieldRef();
// Ensure that the flux at inflow BCs is preserved
forAll(alphaPhic1Bf, patchi)
{
fvsPatchScalarField& alphaPhic1p = alphaPhic1Bf[patchi];
if (!alphaPhic1p.coupled())
{
const scalarField& phi1p = phi1.boundaryField()[patchi];
const scalarField& alpha1p = alpha1.boundaryField()[patchi];
forAll(alphaPhic1p, facei)
{
if (phi1p[facei] < 0)
{
alphaPhic1p[facei] = alpha1p[facei]*phi1p[facei];
}
}
}
}
phase1_.correctInflowOutflow(alphaPhi1);
if (nAlphaSubCycles > 1)
{
@ -355,14 +331,14 @@ void Foam::twoPhaseSystem::solve()
!(++alphaSubCycle).end();
)
{
surfaceScalarField alphaPhic10(alphaPhic1);
surfaceScalarField alphaPhi10(alphaPhi1);
MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
alphaPhic10,
phi_,
alphaPhi10,
(alphaSubCycle.index()*Sp)(),
(Su - (alphaSubCycle.index() - 1)*Sp*alpha1)(),
phase1_.alphaMax(),
@ -371,11 +347,11 @@ void Foam::twoPhaseSystem::solve()
if (alphaSubCycle.index() == 1)
{
phase1_.alphaPhi() = alphaPhic10;
phase1_.alphaPhi() = alphaPhi10;
}
else
{
phase1_.alphaPhi() += alphaPhic10;
phase1_.alphaPhi() += alphaPhi10;
}
}
@ -387,15 +363,15 @@ void Foam::twoPhaseSystem::solve()
(
geometricOneField(),
alpha1,
phi,
alphaPhic1,
phi_,
alphaPhi1,
Sp,
Su,
phase1_.alphaMax(),
0
);
phase1_.alphaPhi() = alphaPhic1;
phase1_.alphaPhi() = alphaPhi1;
}
if (alphaDbyA.valid())
@ -415,8 +391,8 @@ void Foam::twoPhaseSystem::solve()
phase1_.alphaRhoPhi() =
fvc::interpolate(phase1_.rho())*phase1_.alphaPhi();
phase2_.alphaPhi() = phi - phase1_.alphaPhi();
alpha2 = scalar(1) - alpha1;
phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
phase2_.correctInflowOutflow(phase2_.alphaPhi());
phase2_.alphaRhoPhi() =
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
@ -425,6 +401,13 @@ void Foam::twoPhaseSystem::solve()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;
// Ensure the phase-fractions are bounded
alpha1.max(0);
alpha1.min(1);
// Update the phase-fraction of the other phase
alpha2 = scalar(1) - alpha1;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -248,27 +248,19 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties)
}
void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
const volScalarField::Boundary& alphaBf = boundaryField();
const surfaceScalarField::Boundary& phiBf = phi().boundaryField();
// Ensure that the flux at inflow BCs is preserved
forAll(alphaPhiBf, patchi)
{
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
if (!alphaPhip.coupled())
{
const scalarField& phip = phi().boundaryField()[patchi];
const scalarField& alphap = boundaryField()[patchi];
forAll(alphaPhip, facei)
{
if (phip[facei] < SMALL)
{
alphaPhip[facei] = alphap[facei]*phip[facei];
}
}
alphaPhip = phiBf[patchi]*alphaBf[patchi];
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -319,8 +319,8 @@ public:
return alphaRhoPhi_;
}
//- Ensure that the flux at inflow BCs is preserved
void correctInflowFlux(surfaceScalarField& alphaPhi) const;
//- Ensure that the flux at inflow/outflow BCs is preserved
void correctInflowOutflow(surfaceScalarField& alphaPhi) const;
//- Correct the phase properties
// other than the thermodynamics and turbulence

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -444,7 +444,7 @@ void Foam::twoPhaseSystem::solve()
)
);
phase1_.correctInflowFlux(alphaPhic1);
phase1_.correctInflowOutflow(alphaPhic1);
if (nAlphaSubCycles > 1)
{
@ -515,8 +515,7 @@ void Foam::twoPhaseSystem::solve()
fvc::interpolate(phase1_.rho())*phase1_.alphaPhi();
phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
alpha2 = scalar(1) - alpha1;
phase2_.correctInflowFlux(phase2_.alphaPhi());
phase2_.correctInflowOutflow(phase2_.alphaPhi());
phase2_.alphaRhoPhi() =
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
@ -525,6 +524,12 @@ void Foam::twoPhaseSystem::solve()
<< " Min(" << alpha1.name() << ") = " << min(alpha1).value()
<< " Max(" << alpha1.name() << ") = " << max(alpha1).value()
<< endl;
// Ensure the phase-fractions are bounded
alpha1.max(0);
alpha1.min(1);
alpha2 = scalar(1) - alpha1;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,4 +62,3 @@ int main()
// ************************************************************************* //

View File

@ -48,4 +48,3 @@
}
Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;

View File

@ -48,4 +48,3 @@
}
Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -468,7 +468,8 @@ void readCells
IOWarningInFunction(is)
<< "Cell type " << feID << " not supported" << endl;
}
is.getLine(line); // Do nothing
is.getLine(line);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -82,6 +82,11 @@ int main(int argc, char *argv[])
"blockTopology",
"write block edges and centres as .obj files"
);
argList::addBoolOption
(
"noClean",
"keep the existing files in the polyMesh"
);
argList::addOption
(
"dict",
@ -171,6 +176,30 @@ int main(int argc, char *argv[])
dictPath = runTime.system()/regionPath/dictName;
}
if (!args.optionFound("noClean"))
{
fileName polyMeshPath
(
runTime.path()/runTime.constant()/regionPath/polyMesh::meshSubDir
);
if (exists(polyMeshPath))
{
if (exists(polyMeshPath/dictName))
{
Info<< "Not deleting polyMesh directory " << nl
<< " " << polyMeshPath << nl
<< " because it contains " << dictName << endl;
}
else
{
Info<< "Deleting polyMesh directory" << nl
<< " " << polyMeshPath << endl;
rmDir(polyMeshPath);
}
}
}
IOobject meshDictIO
(
dictPath,

View File

@ -666,15 +666,6 @@ void writeMesh
}
refinementHistory::removeFiles(mesh);
//label flag = meshRefinement::MESH;
//if (writeLevel)
//{
// flag |= meshRefinement::SCALARLEVELS;
//}
//if (debug & meshRefinement::OBJINTERSECTIONS)
//{
// flag |= meshRefinement::OBJINTERSECTIONS;
//}
meshRefiner.write
(
debugLevel,
@ -726,117 +717,6 @@ int main(int argc, char *argv[])
autoPtr<fvMesh> meshPtr;
// if (surfaceSimplify)
// {
// IOdictionary foamyHexMeshDict
// (
// IOobject
// (
// "foamyHexMeshDict",
// runTime.system(),
// runTime,
// IOobject::MUST_READ_IF_MODIFIED,
// IOobject::NO_WRITE
// )
// );
//
// const dictionary& motionDict =
// foamyHexMeshDict.subDict("motionControl");
//
// const scalar defaultCellSize =
// readScalar(motionDict.lookup("defaultCellSize"));
//
// Info<< "Constructing single cell mesh from boundBox" << nl << endl;
//
// boundBox bb(args.optionRead<boundBox>("surfaceSimplify"));
//
// labelList owner(6, label(0));
// labelList neighbour(0);
//
// const cellModel& hexa = *(cellModeller::lookup("hex"));
// faceList faces = hexa.modelFaces();
//
// meshPtr.set
// (
// new fvMesh
// (
// IOobject
// (
// fvMesh::defaultRegion,
// runTime.timeName(),
// runTime,
// IOobject::NO_READ
// ),
// xferMove<Field<vector>>(bb.points()()),
// faces.xfer(),
// owner.xfer(),
// neighbour.xfer()
// )
// );
//
// List<polyPatch*> patches(1);
//
// patches[0] = new wallPolyPatch
// (
// "boundary",
// 6,
// 0,
// 0,
// meshPtr().boundaryMesh(),
// wallPolyPatch::typeName
// );
//
// meshPtr().addFvPatches(patches);
//
// const scalar initialCellSize = ::pow(meshPtr().V()[0], 1.0/3.0);
// const label initialRefLevels =
// ::log(initialCellSize/defaultCellSize)/::log(2);
//
// Info<< "Default cell size = " << defaultCellSize << endl;
// Info<< "Initial cell size = " << initialCellSize << endl;
//
// Info<< "Initial refinement levels = " << initialRefLevels << endl;
//
// Info<< "Mesh starting size = " << meshPtr().nCells() << endl;
//
// // meshCutter must be destroyed before writing the mesh otherwise it
// // writes the cellLevel/pointLevel files
// {
// hexRef8 meshCutter(meshPtr(), false);
//
// for (label refinei = 0; refinei < initialRefLevels; ++refinei)
// {
// // Mesh changing engine.
// polyTopoChange meshMod(meshPtr(), true);
//
// // Play refinement commands into mesh changer.
// meshCutter.setRefinement
// (
// identity(meshPtr().nCells()),
// meshMod
// );
//
// // Create mesh (no inflation), return map from old to new mesh
// autoPtr<mapPolyMesh> map =
// meshMod.changeMesh(meshPtr(), false);
//
// // Update fields
// meshPtr().updateMesh(map);
//
// // Delete mesh volumes.
// meshPtr().clearOut();
//
// Info<< "Refinement Iteration " << refinei + 1
// << ", Mesh size = " << meshPtr().nCells() << endl;
// }
// }
//
// Info<< "Mesh end size = " << meshPtr().nCells() << endl;
//
// Info<< "Create mesh" << endl;
// meshPtr().write();
// }
// else
{
word regionName;
if (args.optionReadIfPresent("region", regionName))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -87,10 +87,12 @@ int main(int argc, char *argv[])
#include "createNamedPolyMesh.H"
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
// Search for list of objects for the time of the mesh
word setsInstance = runTime.findInstance
(
polyMesh::meshSubDir/"sets",
setsSubPath,
word::null,
IOobject::MUST_READ,
mesh.facesInstance()
@ -98,7 +100,7 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets"
Info<< "Searched : " << setsInstance/setsSubPath
<< nl
<< "Found : " << objects.names() << nl
<< endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -93,7 +93,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
IOobject::NO_WRITE,
false
),
mesh,
mesh,
dimensioned<Type>("zero", dimless, Zero)
);
@ -142,9 +142,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
}
}
catch (...)
{
// do nothing
}
{}
}
if (!foundFixed)

View File

@ -114,4 +114,3 @@ if (timeDirs.size())
volumeFields.erase(missing);
}
}

View File

@ -40,4 +40,4 @@
Info<< nl << "Time [" << timeIndex << "] = " << runTime.timeName() << nl;
// end-of-file
// end-of-file

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,4 +100,3 @@ int main(int argc, char *argv[])
// ************************************************************************* //

View File

@ -1,4 +1,3 @@
// Do nothing
void USERD_exit_routine
(
void
@ -10,4 +9,3 @@ void USERD_exit_routine
#endif
}

View File

@ -8,4 +8,3 @@ int USERD_get_changing_geometry_status(void)
// Choose the most general option
return Z_CHANGE_CONN;
}

View File

@ -29,4 +29,3 @@ int USERD_get_descrip_lines
#endif
return Z_OK;
}

View File

@ -8,4 +8,3 @@ int USERD_get_element_label_status(void)
#endif
return TRUE;
}

View File

@ -118,6 +118,3 @@ int USERD_get_gold_variable_info
return Z_OK;
}

View File

@ -9,4 +9,3 @@ int USERD_get_node_label_status(void)
return TRUE;
}

View File

@ -41,4 +41,3 @@ int USERD_get_sol_times
return Z_OK;
}

View File

@ -68,4 +68,3 @@ int USERD_get_var_value_at_specific
#endif
return Z_OK;
}

View File

@ -59,4 +59,3 @@ int USERD_get_block_ghost_flags
{
return(Z_OK);
}

View File

@ -32,4 +32,3 @@ else
// Info<< "getLagrangianScalar: nVar = " << nVar << endl;
return Z_UNDEF;
}

View File

@ -44,4 +44,3 @@ else
// Info<< "getLagrangianVector: nVar = " << nVar << endl;
return Z_UNDEF;
}

View File

@ -45,4 +45,3 @@
}
scalarField samples(nIntervals, 0);

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -29,7 +29,7 @@
# Deprecated script extract the 'ExecutionTime' for each time-step from a
# log file for graphing.
#
# Superceded by the more general foamLog script.
# Superseded by the more general foamLog script.
#------------------------------------------------------------------------------
Script=${0##*/}

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -29,7 +29,7 @@
# Deprecated script extract initial turbulence residuals for each time-step
# from a log file for graphing.
#
# Superceded by the more general foamLog script.
# Superseded by the more general foamLog script.
#------------------------------------------------------------------------------
Script=${0##*/}

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -29,7 +29,7 @@
# Deprecated script extract initial velocity and pressure residuals for each
# time-step from a log file for graphing.
#
# Superceded by the more general foamLog script.
# Superseded by the more general foamLog script.
#------------------------------------------------------------------------------
Script=${0##*/}

View File

@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
Script=${0##*/}
echo $Script "has been superceded by the -postProcess solver option:"
echo $Script "has been superseded by the -postProcess solver option:"
echo "<solverName> -funcs '(R components(turbulenceProperties:R))'"
echo "e.g."
echo "simpleFoam -postProcess -funcs '(R components(turbulenceProperties:R))'"

View File

@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
Script=${0##*/}
echo $Script "has been superceded by the postProcess utility:"
echo $Script "has been superseded by the postProcess utility:"
echo " postProcess -func 'grad(U)'"
#------------------------------------------------------------------------------

View File

@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
Script=${0##*/}
echo $Script "has been superceded by the postProcess utility:"
echo $Script "has been superseded by the postProcess utility:"
echo "postProcess -func XiReactionRate"
#------------------------------------------------------------------------------

View File

@ -51,7 +51,6 @@ wmake $targetType sampling
wmake $targetType dynamicFvMesh
wmake $targetType sampling
wmake $targetType topoChangerFvMesh
wmake $targetType sampling
# Compile scotchDecomp, metisDecomp etc.
parallel/Allwmake $targetType $*

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,4 +31,3 @@ void Foam::error::printStack(Ostream& os)
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -341,4 +341,3 @@ void inplaceRotateList(ListType<DataType>& list, label n);
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -119,7 +119,7 @@ public:
//- Return the name of the given enumeration element
const char* operator[](const Enum e) const
{
return names[e];
return names[int(e)];
}
};

View File

@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names:
Ty Coon, President of Vice
That's all there is to it!

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,4 +64,3 @@ dimensionedSphericalTensor inv(const dimensionedSphericalTensor&);
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,4 +86,3 @@ dimensionedTensor operator*(const dimensionedVector&);
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,4 +56,3 @@ typedef dimensioned<vector> dimensionedVector;
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,4 +47,3 @@ namespace Foam
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,4 +47,3 @@ namespace Foam
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -151,16 +151,6 @@ realizableKE<BasicTurbulenceModel>::realizableKE
transport,
propertiesName
),
Cmu_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cmu",
this->coeffDict_,
0.09
)
),
A0_
(
dimensioned<scalar>::lookupOrAddToDict
@ -240,7 +230,6 @@ bool realizableKE<BasicTurbulenceModel>::read()
{
if (eddyViscosity<RASModel<BasicTurbulenceModel>>::read())
{
Cmu_.readIfPresent(this->coeffDict());
A0_.readIfPresent(this->coeffDict());
C2_.readIfPresent(this->coeffDict());
sigmak_.readIfPresent(this->coeffDict());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,6 @@ Description
\verbatim
realizableKECoeffs
{
Cmu 0.09;
A0 4.0;
C2 1.9;
sigmak 1.0;
@ -90,7 +89,6 @@ protected:
// Model coefficients
dimensionedScalar Cmu_;
dimensionedScalar A0_;
dimensionedScalar C2_;
dimensionedScalar sigmak_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "PaSR.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -39,19 +38,18 @@ Foam::combustionModels::PaSR<Type>::PaSR
:
laminar<Type>(modelType, mesh, combustionProperties, phaseName),
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
turbulentReaction_(this->coeffs().lookup("turbulentReaction")),
kappa_
(
IOobject
(
IOobject::groupName("PaSR:kappa", phaseName),
IOobject::groupName(typeName + ":kappa", phaseName),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("kappa", dimless, 0.0)
dimensionedScalar("kappa", dimless, 0)
)
{}
@ -72,35 +70,31 @@ void Foam::combustionModels::PaSR<Type>::correct()
{
laminar<Type>::correct();
if (turbulentReaction_)
{
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const volScalarField& epsilon = tepsilon();
tmp<volScalarField> tmuEff(this->turbulence().muEff());
const volScalarField& muEff = tmuEff();
tmp<volScalarField> ttc(this->tc());
const volScalarField& tc = ttc();
tmp<volScalarField> trho(this->rho());
const volScalarField& rho = trho();
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const scalarField& epsilon = tepsilon();
forAll(epsilon, i)
tmp<volScalarField> tmuEff(this->turbulence().muEff());
const scalarField& muEff = tmuEff();
tmp<volScalarField> ttc(this->tc());
const scalarField& tc = ttc();
tmp<volScalarField> trho(this->rho());
const scalarField& rho = trho();
forAll(epsilon, i)
{
const scalar tk =
Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + SMALL), 0));
if (tk > SMALL)
{
scalar tk =
Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + SMALL), 0));
if (tk > SMALL)
{
kappa_[i] = tc[i]/(tc[i] + tk);
}
else
{
kappa_[i] = 1.0;
}
kappa_[i] = tc[i]/(tc[i] + tk);
}
else
{
kappa_[i] = 1.0;
}
}
else
{
kappa_ = 1.0;
}
}
}
@ -122,7 +116,7 @@ Foam::combustionModels::PaSR<Type>::Qdot() const
(
new volScalarField
(
IOobject::groupName("PaSR:dQ", this->phaseName_),
IOobject::groupName(typeName + ":Qdot", this->phaseName_),
kappa_*laminar<Type>::Qdot()
)
);
@ -135,7 +129,6 @@ bool Foam::combustionModels::PaSR<Type>::read()
if (laminar<Type>::read())
{
this->coeffs().lookup("Cmix") >> Cmix_;
this->coeffs().lookup("turbulentReaction") >> turbulentReaction_;
return true;
}
else

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,10 +28,11 @@ Group
grpCombustionModels
Description
Partially stirred reactor combustion model. The model calculates a finite
rate, based on both turbulence and chemistry time scales. Depending on
mesh resolution, the Cmix parameter can be used to scale the turbulence
mixing time scale.
Partially stirred reactor turbulent combustion model.
This model calculates a finite rate, based on both turbulence and chemistry
time scales. Depending on mesh resolution, the Cmix parameter can be used
to scale the turbulence mixing time scale.
SourceFiles
PaSR.C
@ -64,9 +65,6 @@ class PaSR
//- Mixing constant
scalar Cmix_;
//- Turbulent reaction switch
Switch turbulentReaction_;
//- Mixing parameter
volScalarField kappa_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -170,8 +170,8 @@ bool Foam::combustionModels::laminar<Type>::read()
{
if (Type::read())
{
this->coeffs().lookup("integrateReactionRate")
>> integrateReactionRate_;
integrateReactionRate_ =
this->coeffs().lookupOrDefault("integrateReactionRate", true);
return true;
}
else

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,9 +52,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::~noCombustion()
template<class CombThermoType>
void Foam::combustionModels::noCombustion<CombThermoType>::correct()
{
// Do Nothing
}
{}
template<class CombThermoType>
@ -83,7 +81,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::Qdot() const
(
IOobject
(
IOobject::groupName("Qdot", this->phaseName_),
IOobject::groupName(typeName + ":Qdot", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,4 +94,3 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const refineCell& r)
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -1938,7 +1938,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
polyMesh::meshSubDir,
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
labelList(mesh_.nCells(), 0)
),
@ -1951,7 +1951,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
polyMesh::meshSubDir,
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
labelList(mesh_.nPoints(), 0)
),
@ -1964,7 +1964,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
polyMesh::meshSubDir,
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
dimensionedScalar("level0Edge", dimLength, getLevel0EdgeLength())
),
@ -1977,9 +1977,10 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
(readHistory ? mesh_.nCells() : 0) // All cells visible if not be read
// All cells visible if not read or readHistory = false
(readHistory ? mesh_.nCells() : 0)
),
faceRemover_(mesh_, GREAT), // merge boundary faces wherever possible
savedPointLevel_(0),
@ -2057,7 +2058,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
cellLevel
),
@ -2070,7 +2071,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
pointLevel
),
@ -2083,7 +2084,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
dimensionedScalar
(
@ -2101,7 +2102,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
history
),
@ -2165,7 +2166,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
cellLevel
),
@ -2178,7 +2179,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
pointLevel
),
@ -2191,7 +2192,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
dimensionedScalar
(
@ -2209,7 +2210,7 @@ Foam::hexRef8::hexRef8
polyMesh::meshSubDir,
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
List<refinementHistory::splitCell8>(0),
labelList(0),
@ -3069,7 +3070,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
// fMesh.time().timeName(),
// fMesh,
// IOobject::NO_READ,
// IOobject::AUTO_WRITE,
// IOobject::NO_WRITE,
// false
// ),
// fMesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -336,7 +336,6 @@ void Foam::refinementHistory::freeSplitCell(const label index)
}
// Mark entry in splitCells. Recursively mark its parent and subs.
void Foam::refinementHistory::markSplit
(
const label index,
@ -373,7 +372,6 @@ void Foam::refinementHistory::markSplit
}
// Mark index and all its descendants
void Foam::refinementHistory::mark
(
const label val,
@ -739,7 +737,6 @@ Foam::refinementHistory::refinementHistory
}
// Construct as copy
Foam::refinementHistory::refinementHistory
(
const IOobject& io,
@ -760,7 +757,6 @@ Foam::refinementHistory::refinementHistory
}
// Construct from multiple
Foam::refinementHistory::refinementHistory
(
const IOobject& io,
@ -877,7 +873,6 @@ Foam::refinementHistory::refinementHistory
}
// Construct from Istream
Foam::refinementHistory::refinementHistory(const IOobject& io, Istream& is)
:
regIOobject(io),
@ -1154,7 +1149,6 @@ void Foam::refinementHistory::updateMesh(const mapPolyMesh& map)
}
// Update numbering for subsetting
void Foam::refinementHistory::subset
(
const labelList& pointMap,

View File

@ -238,7 +238,6 @@ fvMatrices/fvMatrices.C
fvMatrices/fvScalarMatrix/fvScalarMatrix.C
fvMatrices/solvers/MULES/MULES.C
fvMatrices/solvers/MULES/CMULES.C
fvMatrices/solvers/MULES/IMULES.C
fvMatrices/solvers/GAMGSymSolver/GAMGAgglomerations/faceAreaPairGAMGAgglomeration/faceAreaPairGAMGAgglomeration.C
interpolation = interpolation/interpolation

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -151,17 +151,17 @@ void Foam::MULES::limiterCorr
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label nLimiterIter
const label nLimiterIter
(
readLabel(MULEScontrols.lookup("nLimiterIter"))
);
scalar smoothLimiter
const scalar smoothLimiter
(
MULEScontrols.lookupOrDefault<scalar>("smoothLimiter", 0)
);
scalar extremaCoeff
const scalar extremaCoeff
(
MULEScontrols.lookupOrDefault<scalar>("extremaCoeff", 0)
);
@ -207,8 +207,8 @@ void Foam::MULES::limiterCorr
forAll(phiCorrIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
const label own = owner[facei];
const label nei = neighb[facei];
psiMaxn[own] = max(psiMaxn[own], psiIf[nei]);
psiMinn[own] = min(psiMinn[own], psiIf[nei]);
@ -216,9 +216,9 @@ void Foam::MULES::limiterCorr
psiMaxn[nei] = max(psiMaxn[nei], psiIf[own]);
psiMinn[nei] = min(psiMinn[nei], psiIf[own]);
scalar phiCorrf = phiCorrIf[facei];
const scalar phiCorrf = phiCorrIf[facei];
if (phiCorrf > 0.0)
if (phiCorrf > 0)
{
sumPhip[own] += phiCorrf;
mSumPhim[nei] += phiCorrf;
@ -253,7 +253,7 @@ void Foam::MULES::limiterCorr
{
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPf[pFacei]);
psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPf[pFacei]);
@ -262,11 +262,11 @@ void Foam::MULES::limiterCorr
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
scalar phiCorrf = phiCorrPf[pFacei];
const scalar phiCorrf = phiCorrPf[pFacei];
if (phiCorrf > 0.0)
if (phiCorrf > 0)
{
sumPhip[pfCelli] += phiCorrf;
}
@ -309,17 +309,17 @@ void Foam::MULES::limiterCorr
for (int j=0; j<nLimiterIter; j++)
{
sumlPhip = 0.0;
mSumlPhim = 0.0;
sumlPhip = 0;
mSumlPhim = 0;
forAll(lambdaIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
const label own = owner[facei];
const label nei = neighb[facei];
scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
const scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
if (lambdaPhiCorrf > 0.0)
if (lambdaPhiCorrf > 0)
{
sumlPhip[own] += lambdaPhiCorrf;
mSumlPhim[nei] += lambdaPhiCorrf;
@ -344,7 +344,7 @@ void Foam::MULES::limiterCorr
scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
if (lambdaPhiCorrf > 0.0)
if (lambdaPhiCorrf > 0)
{
sumlPhip[pfCelli] += lambdaPhiCorrf;
}
@ -379,7 +379,7 @@ void Foam::MULES::limiterCorr
forAll(lambdaIf, facei)
{
if (phiCorrIf[facei] > 0.0)
if (phiCorrIf[facei] > 0)
{
lambdaIf[facei] = min
(
@ -415,9 +415,9 @@ void Foam::MULES::limiterCorr
forAll(lambdaPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
if (phiCorrfPf[pFacei] > 0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);
@ -438,11 +438,11 @@ void Foam::MULES::limiterCorr
forAll(lambdaPf, pFacei)
{
// Limit outlet faces only
if (phiPf[pFacei] > SMALL*SMALL)
if ((phiPf[pFacei] + phiCorrfPf[pFacei]) > SMALL*SMALL)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
if (phiCorrfPf[pFacei] > 0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);

View File

@ -1,54 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "IMULES.H"
#include "profiling.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::MULES::implicitSolve
(
volScalarField& psi,
const surfaceScalarField& phi,
surfaceScalarField& phiPsi,
const scalar psiMax,
const scalar psiMin
)
{
addProfiling(solve, "MULES::implicitSolve");
implicitSolve
(
geometricOneField(),
psi,
phi,
phiPsi,
zeroField(), zeroField(),
psiMax, psiMin
);
}
// ************************************************************************* //

View File

@ -1,94 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 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/>.
Global
IMULES
Description
IMULES: Multidimensional universal limiter for implicit solution.
Solve a convective-only transport equation using an explicit universal
multi-dimensional limiter applied to an implicit formulation requiring
iteration to guarantee boundedness. The number of iterations required
to obtain boundedness increases with the Courant number of the simulation.
It may be more efficient to use CMULES.
SourceFiles
IMULES.C
IMULESTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef IMULES_H
#define IMULES_H
#include "MULES.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace MULES
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class RhoType, class SpType, class SuType>
void implicitSolve
(
const RhoType& rho,
volScalarField& gamma,
const surfaceScalarField& phi,
surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
);
void implicitSolve
(
volScalarField& gamma,
const surfaceScalarField& phi,
surfaceScalarField& phiCorr,
const scalar psiMax,
const scalar psiMin
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace MULES
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "IMULESTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,239 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "IMULES.H"
#include "gaussConvectionScheme.H"
#include "surfaceInterpolate.H"
#include "fvmDdt.H"
#include "fvmSup.H"
#include "fvcDiv.H"
#include "profiling.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace MULES
{
template<class RhoType>
inline tmp<surfaceScalarField> interpolate(const RhoType& rho)
{
NotImplemented;
return tmp<surfaceScalarField>(nullptr);
}
template<>
inline tmp<surfaceScalarField> interpolate(const volScalarField& rho)
{
return fvc::interpolate(rho);
}
}
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::implicitSolve
(
const RhoType& rho,
volScalarField& psi,
const surfaceScalarField& phi,
surfaceScalarField& phiPsi,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
)
{
addProfiling(solve, "MULES::implicitSolve");
const fvMesh& mesh = psi.mesh();
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label maxIter
(
readLabel(MULEScontrols.lookup("maxIter"))
);
scalar maxUnboundedness
(
readScalar(MULEScontrols.lookup("maxUnboundedness"))
);
scalar CoCoeff
(
readScalar(MULEScontrols.lookup("CoCoeff"))
);
scalarField allCoLambda(mesh.nFaces());
{
slicedSurfaceScalarField CoLambda
(
IOobject
(
"CoLambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allCoLambda,
false // Use slices for the couples
);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
tmp<surfaceScalarField> Cof =
mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs()
*mag(phi/interpolate(rho))/mesh.magSf();
CoLambda == 1.0/max(CoCoeff*Cof, scalar(1));
}
else
{
tmp<surfaceScalarField> Cof =
mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs()
*mag(phi)/mesh.magSf();
CoLambda == 1.0/max(CoCoeff*Cof, scalar(1));
}
}
scalarField allLambda(allCoLambda);
//scalarField allLambda(mesh.nFaces(), 1.0);
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
linear<scalar> CDs(mesh);
upwind<scalar> UDs(mesh, phi);
//fv::uncorrectedSnGrad<scalar> snGrads(mesh);
fvScalarMatrix psiConvectionDiffusion
(
fvm::ddt(rho, psi)
+ fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi)
//- fv::gaussLaplacianScheme<scalar, scalar>(mesh, CDs, snGrads)
//.fvmLaplacian(Dpsif, psi)
- fvm::Sp(Sp, psi)
- Su
);
surfaceScalarField phiBD(psiConvectionDiffusion.flux());
surfaceScalarField& phiCorr = phiPsi;
phiCorr -= phiBD;
for (label i=0; i<maxIter; i++)
{
if (i != 0 && i < 4)
{
allLambda = allCoLambda;
}
limiter
(
allLambda,
1.0/mesh.time().deltaTValue(),
rho,
psi,
phiBD,
phiCorr,
Sp,
Su,
psiMax,
psiMin
);
solve
(
psiConvectionDiffusion + fvc::div(lambda*phiCorr),
MULEScontrols
);
scalar maxPsiM1 = gMax(psi.primitiveField()) - 1.0;
scalar minPsi = gMin(psi.primitiveField());
scalar unboundedness = max(max(maxPsiM1, 0.0), -min(minPsi, 0.0));
if (unboundedness < maxUnboundedness)
{
break;
}
else
{
Info<< "MULES: max(" << psi.name() << " - 1) = " << maxPsiM1
<< " min(" << psi.name() << ") = " << minPsi << endl;
phiBD = psiConvectionDiffusion.flux();
/*
word gammaScheme("div(phi,gamma)");
word gammarScheme("div(phirb,gamma)");
const surfaceScalarField& phir =
mesh.lookupObject<surfaceScalarField>("phir");
phiCorr =
fvc::flux
(
phi,
psi,
gammaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, scalar(1) - psi, gammarScheme),
psi,
gammarScheme
)
- phiBD;
*/
}
}
phiPsi = psiConvectionDiffusion.flux() + lambda*phiCorr;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -185,12 +185,12 @@ void Foam::MULES::limiter
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label nLimiterIter
const label nLimiterIter
(
MULEScontrols.lookupOrDefault<label>("nLimiterIter", 3)
);
scalar smoothLimiter
const scalar smoothLimiter
(
MULEScontrols.lookupOrDefault<scalar>("smoothLimiter", 0)
);
@ -228,8 +228,7 @@ void Foam::MULES::limiter
);
scalarField& lambdaIf = lambda;
surfaceScalarField::Boundary& lambdaBf =
lambda.boundaryFieldRef();
surfaceScalarField::Boundary& lambdaBf = lambda.boundaryFieldRef();
scalarField psiMaxn(psiIf.size(), psiMin);
scalarField psiMinn(psiIf.size(), psiMax);
@ -241,8 +240,8 @@ void Foam::MULES::limiter
forAll(phiCorrIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
const label own = owner[facei];
const label nei = neighb[facei];
psiMaxn[own] = max(psiMaxn[own], psiIf[nei]);
psiMinn[own] = min(psiMinn[own], psiIf[nei]);
@ -253,9 +252,9 @@ void Foam::MULES::limiter
sumPhiBD[own] += phiBDIf[facei];
sumPhiBD[nei] -= phiBDIf[facei];
scalar phiCorrf = phiCorrIf[facei];
const scalar phiCorrf = phiCorrIf[facei];
if (phiCorrf > 0.0)
if (phiCorrf > 0)
{
sumPhip[own] += phiCorrf;
mSumPhim[nei] += phiCorrf;
@ -281,7 +280,7 @@ void Foam::MULES::limiter
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPNf[pFacei]);
psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPNf[pFacei]);
@ -291,7 +290,7 @@ void Foam::MULES::limiter
{
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPf[pFacei]);
psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPf[pFacei]);
@ -300,13 +299,13 @@ void Foam::MULES::limiter
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
sumPhiBD[pfCelli] += phiBDPf[pFacei];
scalar phiCorrf = phiCorrPf[pFacei];
const scalar phiCorrf = phiCorrPf[pFacei];
if (phiCorrf > 0.0)
if (phiCorrf > 0)
{
sumPhip[pfCelli] += phiCorrf;
}
@ -376,17 +375,17 @@ void Foam::MULES::limiter
for (int j=0; j<nLimiterIter; j++)
{
sumlPhip = 0.0;
mSumlPhim = 0.0;
sumlPhip = 0;
mSumlPhim = 0;
forAll(lambdaIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
const label own = owner[facei];
const label nei = neighb[facei];
scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
if (lambdaPhiCorrf > 0.0)
if (lambdaPhiCorrf > 0)
{
sumlPhip[own] += lambdaPhiCorrf;
mSumlPhim[nei] += lambdaPhiCorrf;
@ -407,11 +406,11 @@ void Foam::MULES::limiter
forAll(lambdaPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
const scalar lambdaPhiCorrf =
lambdaPf[pFacei]*phiCorrfPf[pFacei];
scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
if (lambdaPhiCorrf > 0.0)
if (lambdaPhiCorrf > 0)
{
sumlPhip[pfCelli] += lambdaPhiCorrf;
}
@ -446,7 +445,7 @@ void Foam::MULES::limiter
forAll(lambdaIf, facei)
{
if (phiCorrIf[facei] > 0.0)
if (phiCorrIf[facei] > 0)
{
lambdaIf[facei] = min
(
@ -464,7 +463,6 @@ void Foam::MULES::limiter
}
}
forAll(lambdaBf, patchi)
{
fvsPatchScalarField& lambdaPf = lambdaBf[patchi];
@ -482,9 +480,9 @@ void Foam::MULES::limiter
forAll(lambdaPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
const label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
if (phiCorrfPf[pFacei] > 0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);
@ -496,33 +494,6 @@ void Foam::MULES::limiter
}
}
}
else
{
const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
const scalarField& phiBDPf = phiBDBf[patchi];
const scalarField& phiCorrPf = phiCorrBf[patchi];
forAll(lambdaPf, pFacei)
{
// Limit outlet faces only
if ((phiBDPf[pFacei] + phiCorrPf[pFacei]) > SMALL*SMALL)
{
label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);
}
else
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdam[pfCelli]);
}
}
}
}
}
syncTools::syncFaceList(mesh, allLambda, minEqOp<scalar>());
@ -549,6 +520,19 @@ void Foam::MULES::limit
surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi));
surfaceScalarField::Boundary& phiBDBf = phiBD.boundaryFieldRef();
const surfaceScalarField::Boundary& phiPsiBf = phiPsi.boundaryField();
forAll(phiBDBf, patchi)
{
fvsPatchScalarField& phiBDPf = phiBDBf[patchi];
if (!phiBDPf.coupled())
{
phiBDPf = phiPsiBf[patchi];
}
}
surfaceScalarField& phiCorr = phiPsi;
phiCorr -= phiBD;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,9 +71,7 @@ void Foam::CFCFaceToCellStencil::calcFaceBoundaryData
}
}
else if (isA<emptyPolyPatch>(pp))
{
// Do nothing.
}
{}
else
{
// Do nothing since face itself already in stencil

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -43,9 +43,7 @@ void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldi)
Log << " Reading/initialising field " << meanFieldName << endl;
if (foundObject<Type>(meanFieldName))
{
// do nothing
}
{}
else if (obr().found(meanFieldName))
{
Log << " Cannot allocate average field " << meanFieldName
@ -120,9 +118,7 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
Log << " Reading/initialising field " << prime2MeanFieldName << nl;
if (foundObject<Type2>(prime2MeanFieldName))
{
// do nothing
}
{}
else if (obr().found(prime2MeanFieldName))
{
Log << " Cannot allocate average field " << prime2MeanFieldName

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -135,6 +135,8 @@ protected:
(
const word& fieldName,
const word& outputName,
const label minCell,
const label maxCell,
const vector& minC,
const vector& maxC,
const label minProci,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -33,6 +33,8 @@ void Foam::functionObjects::fieldMinMax::output
(
const word& fieldName,
const word& outputName,
const label minCell,
const label maxCell,
const vector& minC,
const vector& maxC,
const label minProci,
@ -68,6 +70,7 @@ void Foam::functionObjects::fieldMinMax::output
file<< endl;
Log << " min(" << outputName << ") = " << minValue
<< " in cell " << minCell
<< " at location " << minC;
if (Pstream::parRun())
@ -76,6 +79,7 @@ void Foam::functionObjects::fieldMinMax::output
}
Log << nl << " max(" << outputName << ") = " << maxValue
<< " in cell " << maxCell
<< " at location " << maxC;
if (Pstream::parRun())
@ -96,9 +100,11 @@ void Foam::functionObjects::fieldMinMax::output
// Write state/results information
word nameStr('(' + outputName + ')');
this->setResult("min" + nameStr, minValue);
this->setResult("min" + nameStr + "_cell", minCell);
this->setResult("min" + nameStr + "_position", minC);
this->setResult("min" + nameStr + "_processor", minProci);
this->setResult("max" + nameStr, maxValue);
this->setResult("max" + nameStr + "_cell", maxCell);
this->setResult("max" + nameStr + "_position", maxC);
this->setResult("max" + nameStr + "_processor", maxProci);
}
@ -131,17 +137,19 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
magField.boundaryField();
scalarList minVs(Pstream::nProcs());
labelList minCells(Pstream::nProcs());
List<vector> minCs(Pstream::nProcs());
label minProci = findMin(magField);
minVs[proci] = magField[minProci];
minCells[proci] = minProci;
minCs[proci] = mesh_.C()[minProci];
labelList maxIs(Pstream::nProcs());
scalarList maxVs(Pstream::nProcs());
labelList maxCells(Pstream::nProcs());
List<vector> maxCs(Pstream::nProcs());
label maxProci = findMax(magField);
maxVs[proci] = magField[maxProci];
maxCells[proci] = maxProci;
maxCs[proci] = mesh_.C()[maxProci];
forAll(magFieldBoundary, patchi)
@ -151,10 +159,14 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
{
const vectorField& Cfp = CfBoundary[patchi];
const labelList& faceCells =
magFieldBoundary[patchi].patch().faceCells();
label minPi = findMin(mfp);
if (mfp[minPi] < minVs[proci])
{
minVs[proci] = mfp[minPi];
minCells[proci] = faceCells[minPi];
minCs[proci] = Cfp[minPi];
}
@ -162,6 +174,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
if (mfp[maxPi] > maxVs[proci])
{
maxVs[proci] = mfp[maxPi];
maxCells[proci] = faceCells[maxPi];
maxCs[proci] = Cfp[maxPi];
}
}
@ -169,11 +182,15 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
Pstream::gatherList(minVs);
Pstream::scatterList(minVs);
Pstream::gatherList(minCells);
Pstream::scatterList(minCells);
Pstream::gatherList(minCs);
Pstream::scatterList(minCs);
Pstream::gatherList(maxVs);
Pstream::scatterList(maxVs);
Pstream::gatherList(maxCells);
Pstream::scatterList(maxCells);
Pstream::gatherList(maxCs);
Pstream::scatterList(maxCs);
@ -189,6 +206,8 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
(
fieldName,
word("mag(" + fieldName + ")"),
minCell,
maxCell,
minC,
maxC,
mini,
@ -204,31 +223,37 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
fieldBoundary = field.boundaryField();
List<Type> minVs(Pstream::nProcs());
labelList minCells(Pstream::nProcs());
List<vector> minCs(Pstream::nProcs());
label minProci = findMin(field);
minVs[proci] = field[minProci];
minCells[proci] = minProci;
minCs[proci] = mesh_.C()[minProci];
Pstream::gatherList(minVs);
Pstream::gatherList(minCs);
List<Type> maxVs(Pstream::nProcs());
labelList maxCells(Pstream::nProcs());
List<vector> maxCs(Pstream::nProcs());
label maxProci = findMax(field);
maxVs[proci] = field[maxProci];
maxCells[proci] = maxProci;
maxCs[proci] = mesh_.C()[maxProci];
forAll(fieldBoundary, patchi)
{
const Field<Type>& fp = fieldBoundary[patchi];
if (fp.size())
{
const vectorField& Cfp = CfBoundary[patchi];
const labelList& faceCells =
fieldBoundary[patchi].patch().faceCells();
label minPi = findMin(fp);
if (fp[minPi] < minVs[proci])
{
minVs[proci] = fp[minPi];
minCells[proci] = faceCells[minPi];
minCs[proci] = Cfp[minPi];
}
@ -236,6 +261,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
if (fp[maxPi] > maxVs[proci])
{
maxVs[proci] = fp[maxPi];
maxCells[proci] = faceCells[maxPi];
maxCs[proci] = Cfp[maxPi];
}
}
@ -243,26 +269,34 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
Pstream::gatherList(minVs);
Pstream::scatterList(minVs);
Pstream::gatherList(minCells);
Pstream::scatterList(minCells);
Pstream::gatherList(minCs);
Pstream::scatterList(minCs);
Pstream::gatherList(maxVs);
Pstream::scatterList(maxVs);
Pstream::gatherList(maxCells);
Pstream::scatterList(maxCells);
Pstream::gatherList(maxCs);
Pstream::scatterList(maxCs);
label mini = findMin(minVs);
Type minValue = minVs[mini];
const label minCell = minCells[mini];
const vector& minC = minCs[mini];
label maxi = findMax(maxVs);
Type maxValue = maxVs[maxi];
const label maxCell = maxCells[maxi];
const vector& maxC = maxCs[maxi];
output
(
fieldName,
fieldName,
minCell,
maxCell,
minC,
maxC,
mini,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -42,17 +42,21 @@ Usage
writeControl writeTime;
setFormat vtk;
U U;
trackForward yes;
fields
(
U
p
);
lifeTime 10000;
trackLength 1e-3;
nSubCycle 5;
bounds (0.2 -10 -10)(0.22 10 10);
cloudName particleTracks;
seedSampleSet uniform;
uniformCoeffs
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -291,6 +291,16 @@ bool Foam::functionObjects::codedFunctionObject::read(const dictionary& dict)
);
}
if(!dataPtr && !readPtr && !execPtr && !writePtr && !endPtr)
{
IOWarningInFunction
(
dict
) << "No critical \"code\" prefixed keywords were found."
<< " Please check the code documentation for more details."
<< nl << endl;
}
updateLibrary(name_);
return redirectFunctionObject().read(dict);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,16 +30,18 @@ Group
Description
Provides a general interface to enable dynamic code compilation.
The entries are
codeInclude : include files
codeOptions : include paths; inserted into EXE_INC in Make/options
codeLibs : link line; inserted into LIB_LIBS in Make/options
codeData : c++; local member data (null constructed);
localCode : c++; local static functions
codeRead : c++; upon functionObject::read();
codeExecute : c++;upon functionObject::execute();
codeWrite : c++; upon functionObject::write()
codeEnd : c++; upon functionObject::end();
The entries are:
\plaintable
codeInclude | include files
codeOptions | include paths; inserted into EXE_INC in Make/options
codeLibs | link line; inserted into LIB_LIBS in Make/options
codeData | c++; local member data (null constructed);
localCode | c++; local static functions;
codeRead | c++; upon functionObject::read();
codeExecute | c++; upon functionObject::execute();
codeWrite | c++; upon functionObject::write()
codeEnd | c++; upon functionObject::end();
\endplaintable
Usage
Example of function object specification:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,9 +91,7 @@ void Foam::fixedTrim::correct
const vectorField& U,
vectorField& force
)
{
// do nothing
}
{}
void Foam::fixedTrim::correct
@ -101,9 +99,7 @@ void Foam::fixedTrim::correct
const volScalarField rho,
const vectorField& U,
vectorField& force)
{
// do nothing
}
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,4 +47,3 @@ License
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -95,9 +95,7 @@ Foam::CloudFunctionObject<CloudType>::~CloudFunctionObject()
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::preEvolve()
{
// do nothing
}
{}
template<class CloudType>
@ -119,9 +117,7 @@ void Foam::CloudFunctionObject<CloudType>::postMove
const point&,
bool&
)
{
// do nothing
}
{}
template<class CloudType>
@ -133,9 +129,7 @@ void Foam::CloudFunctionObject<CloudType>::postPatch
const tetIndices&,
bool&
)
{
// do nothing
}
{}
template<class CloudType>
@ -145,9 +139,7 @@ void Foam::CloudFunctionObject<CloudType>::postFace
const label,
bool&
)
{
// do nothing
}
{}
template<class CloudType>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -171,7 +171,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
}
else
{
// set 4 quadrants for single sector cases
// Set 4 quadrants for single sector cases
nS = 4;
vector tangent = Zero;
@ -200,7 +200,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
label nPoint = radius_.size()*nPointPerRadius;
label nFace = radius_.size()*nS;
// add origin
// Add origin
nPoint++;
points_.setSize(nPoint);
@ -213,7 +213,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
points_[0] = origin;
// points
// Points
forAll(radius_, radI)
{
label pointOffset = radI*nPointPerRadius + 1;
@ -226,7 +226,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
}
}
// faces
// Faces
DynamicList<label> facePts(2*nPointPerSector);
forAll(radius_, radI)
{
@ -236,7 +236,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
{
facePts.clear();
// append origin point
// Append origin point
facePts.append(0);
for (label ptI = 0; ptI < nPointPerSector; ptI++)
@ -304,16 +304,16 @@ void Foam::ParticleCollector<CloudType>::collectParcelPolygon
if (sign(d1) == sign(d2))
{
// did not cross polygon plane
// Did not cross polygon plane
continue;
}
// intersection point
// Intersection point
const point pIntersect = p1 + (d1/(d1 - d2))*(p2 - p1);
const List<face>& tris = faceTris_[facei];
// identify if point is within poly bounds
// Identify if point is within poly bounds
forAll(tris, triI)
{
const face& tri = tris[triI];
@ -347,11 +347,11 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
if (sign(d1) == sign(d2))
{
// did not cross plane
// Did not cross plane
return;
}
// intersection point in cylindrical co-ordinate system
// Intersection point in cylindrical co-ordinate system
const point pCyl = coordSys_.localPosition(p1 + (d1/(d1 - d2))*(p2 - p1));
scalar r = pCyl[0];
@ -380,6 +380,8 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
);
}
if (secI != -1)
{
hitFaceIDs_.append(secI);
}
}
@ -657,7 +659,7 @@ void Foam::ParticleCollector<CloudType>::postMove
return;
}
// slightly extend end position to avoid falling within tracking tolerances
// Slightly extend end position to avoid falling within tracking tolerances
const point position1 = position0 + 1.0001*(p.position() - position0);
hitFaceIDs_.clear();
@ -675,8 +677,7 @@ void Foam::ParticleCollector<CloudType>::postMove
break;
}
default:
{
}
{}
}
@ -687,15 +688,33 @@ void Foam::ParticleCollector<CloudType>::postMove
if (negateParcelsOppositeNormal_)
{
scalar Unormal = 0;
vector Uhat = p.U();
Uhat /= mag(Uhat) + ROOTVSMALL;
if ((Uhat & normal_[facei]) < 0)
switch (mode_)
{
m *= -1.0;
case mtPolygon:
{
Unormal = Uhat & normal_[facei];
break;
}
case mtConcentricCircle:
{
Unormal = Uhat & normal_[0];
break;
}
default:
{}
}
Uhat /= mag(Uhat) + ROOTVSMALL;
if (Unormal < 0)
{
m = -m;
}
}
// add mass contribution
// Add mass contribution
mass_[facei] += m;
if (nSector_ == 1)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,7 +68,6 @@ Foam::vector Foam::NoDispersion<CloudType>::update
scalar&
)
{
// Do nothing
return Uc;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -155,9 +155,7 @@ Foam::InflationInjection<CloudType>::~InflationInjection()
template<class CloudType>
void Foam::InflationInjection<CloudType>::updateMesh()
{
// do nothing
}
{}
template<class CloudType>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -201,29 +201,57 @@ void Foam::patchInjectionBase::setPositionAndCell
// Position perturbed away from face (into domain)
const scalar a = rnd.position(scalar(0.1), scalar(0.5));
const vector& pc = mesh.cellCentres()[cellOwner];
const vector d = mag(pf - pc)*patchNormal_[facei];
const vector d =
mag((pf - pc) & patchNormal_[facei])*patchNormal_[facei];
position = pf - a*d;
// The position is between the face and cell centre, which could
// be in any tet of the decomposed cell, so arbitrarily choose the
// first face of the cell as the tetFace and the first point after
// the base point on the face as the tetPt. The tracking will pick
// the cell consistent with the motion in the first tracking step
//tetFaceI = mesh.cells()[cellOwner][0];
//tetPtI = 1;
// Try to find tetFacei and tetPti in the current position
mesh.findTetFacePt(cellOwner, position, tetFacei, tetPti);
//SAF: temporary fix for patchInjection.
// This function finds both cellOwner and tetFaceI. The particle
// was injected in a non-boundary cell and the tracking function
// could not find the cellOwner
mesh.findCellFacePt
(
position,
cellOwner,
tetFacei,
tetPti
);
// tetFacei and tetPti not found, check if the cell has changed
if (tetFacei == -1 ||tetPti == -1)
{
mesh.findCellFacePt(position, cellOwner, tetFacei, tetPti);
}
// Both searches failed, choose a random position within
// the original cell
if (tetFacei == -1 ||tetPti == -1)
{
// Reset cellOwner
cellOwner = cellOwners_[facei];
const scalarField& V = mesh.V();
// Construct cell tet indices
const List<tetIndices> cellTetIs =
polyMeshTetDecomposition::cellTetIndices(mesh, cellOwner);
// Construct cell tet volume fractions
scalarList cTetVFrac(cellTetIs.size(), 0.0);
for (label teti=1; teti<cellTetIs.size()-1; teti++)
{
cTetVFrac[teti] =
cTetVFrac[teti-1]
+ cellTetIs[teti].tet(mesh).mag()/V[cellOwner];
}
cTetVFrac.last() = 1;
// Set new particle position
const scalar volFrac = rnd.sample01<scalar>();
label teti = 0;
forAll(cTetVFrac, vfI)
{
if (cTetVFrac[vfI] > volFrac)
{
teti = vfI;
break;
}
}
position = cellTetIs[teti].tet(mesh).randomPoint(rnd);
tetFacei = cellTetIs[teti].face();
tetPti = cellTetIs[teti].tetPt();
}
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -67,9 +67,7 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction
break;
}
default:
{
// do nothing
}
{}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,9 +29,7 @@ License
template<class CloudType>
void Foam::NoStochasticCollision<CloudType>::collide(const scalar)
{
// do nothing
}
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,9 +59,7 @@ Foam::IsotropyModels::NoIsotropy<CloudType>::~NoIsotropy()
template<class CloudType>
void Foam::IsotropyModels::NoIsotropy<CloudType>::calculate()
{
// do nothing
}
{}
template<class CloudType>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,8 +86,7 @@ Foam::scalar Foam::NoSurfaceReaction<CloudType>::calculate
scalarField&
) const
{
// do nothing
return 0.0;
return 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,4 +66,3 @@ namespace Foam
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,7 +88,6 @@ bool Foam::NoBreakup<CloudType>::update
scalar& massChild
)
{
// Do nothing
return false;
}

View File

@ -11,5 +11,3 @@
}
rNew = 0.04*n*rs;
}

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ class snapParameters;
/*---------------------------------------------------------------------------*\
Class meshRefinement Declaration
Class meshRefinement Declaration
\*---------------------------------------------------------------------------*/
class meshRefinement
@ -91,17 +91,16 @@ public:
enum IOdebugType
{
IOMESH,
//IOSCALARLEVELS,
IOOBJINTERSECTIONS,
IOFEATURESEEDS,
IOATTRACTION,
IOLAYERINFO
};
static const NamedEnum<IOdebugType, 5> IOdebugTypeNames;
enum debugType
{
MESH = 1<<IOMESH,
//SCALARLEVELS = 1<<IOSCALARLEVELS,
OBJINTERSECTIONS = 1<<IOOBJINTERSECTIONS,
FEATURESEEDS = 1<<IOFEATURESEEDS,
ATTRACTION = 1<< IOATTRACTION,
@ -113,6 +112,7 @@ public:
{
IOOUTPUTLAYERINFO
};
static const NamedEnum<IOoutputType, 1> IOoutputTypeNames;
enum outputType
{
@ -123,14 +123,17 @@ public:
enum IOwriteType
{
IOWRITEMESH,
IONOWRITEREFINEMENT,
IOWRITELEVELS,
IOWRITELAYERSETS,
IOWRITELAYERFIELDS
};
static const NamedEnum<IOwriteType, 4> IOwriteTypeNames;
static const NamedEnum<IOwriteType, 5> IOwriteTypeNames;
enum writeType
{
WRITEMESH = 1<<IOWRITEMESH,
NOWRITEREFINEMENT = 1<<IONOWRITEREFINEMENT,
WRITELEVELS = 1<<IOWRITELEVELS,
WRITELAYERSETS = 1<<IOWRITELAYERSETS,
WRITELAYERFIELDS = 1<<IOWRITELAYERFIELDS
@ -1481,7 +1484,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "meshRefinementTemplates.C"
#include "meshRefinementTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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