Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
sergio
2016-12-12 10:36:33 -08:00
604 changed files with 10106 additions and 2368 deletions

3
.gitignore vendored
View File

@ -75,9 +75,10 @@ doc/Doxygen/DTAGS
# Ignore .tags in the main directory # Ignore .tags in the main directory
/.tags /.tags
# Ignore eclipse project files in the main directory # Ignore project files in the main directory
/.cproject /.cproject
/.project /.project
/.dir-locals.el
# Ignore the test directory # Ignore the test directory
/tutorialsTest /tutorialsTest

View File

@ -17,10 +17,7 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
exit 1 exit 1
} }
set -x
wmake -all $targetType solvers wmake -all $targetType solvers
wmake -all $targetType utilities wmake -all $targetType utilities
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -12,7 +12,7 @@
( (
"initialConditions", "initialConditions",
runTime.constant(), runTime.constant(),
runTime, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
@ -37,7 +37,7 @@
( (
"rho", "rho",
runTime.timeName(), runTime.timeName(),
runTime, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
@ -50,7 +50,7 @@
( (
"Rspecific", "Rspecific",
runTime.timeName(), runTime.timeName(),
runTime, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
@ -69,7 +69,7 @@
( (
"U", "U",
runTime.timeName(), runTime.timeName(),
runTime, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso BCs wclean libso BCs
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
(wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam) (wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)

View File

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1
set -x
wclean libso DPMTurbulenceModels wclean libso DPMTurbulenceModels
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType DPMTurbulenceModels wmake $targetType DPMTurbulenceModels

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso twoPhaseMixtureThermo wclean libso twoPhaseMixtureThermo
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType twoPhaseMixtureThermo wmake $targetType twoPhaseMixtureThermo

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso multiphaseMixtureThermo wclean libso multiphaseMixtureThermo
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType multiphaseMixtureThermo wmake $targetType multiphaseMixtureThermo
wmake $targetType wmake $targetType

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso mixtureViscosityModels wclean libso mixtureViscosityModels
wclean libso relativeVelocityModels wclean libso relativeVelocityModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType mixtureViscosityModels wmake $targetType mixtureViscosityModels
wmake $targetType relativeVelocityModels wmake $targetType relativeVelocityModels

View File

@ -24,6 +24,9 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "relativeVelocityModel.H" #include "relativeVelocityModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "partialSlipFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,6 +36,34 @@ namespace Foam
defineRunTimeSelectionTable(relativeVelocityModel, dictionary); defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
{
const volVectorField& U = mixture_.U();
wordList UdmTypes
(
U.boundaryField().size(),
calculatedFvPatchScalarField::typeName
);
forAll(U.boundaryField(), i)
{
if
(
isA<fixedValueFvPatchVectorField>(U.boundaryField()[i])
|| isA<slipFvPatchVectorField>(U.boundaryField()[i])
|| isA<partialSlipFvPatchVectorField>(U.boundaryField()[i])
)
{
UdmTypes[i] = fixedValueFvPatchVectorField::typeName;
}
}
return UdmTypes;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel
"Udm", "Udm",
alphac_.time().timeName(), alphac_.time().timeName(),
alphac_.mesh(), alphac_.mesh(),
IOobject::NO_READ, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
alphac_.mesh(), alphac_.mesh(),
dimensionedVector("Udm", dimVelocity, Zero) dimensionedVector("Udm", dimVelocity, Zero),
UdmPatchFieldTypes()
) )
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,12 +52,16 @@ class relativeVelocityModel
{ {
// Private Member Functions // Private Member Functions
//- Return the list of patchFieldTypes for Udm derived from U
wordList UdmPatchFieldTypes() const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
relativeVelocityModel(const relativeVelocityModel&); relativeVelocityModel(const relativeVelocityModel&);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const relativeVelocityModel&); void operator=(const relativeVelocityModel&);
protected: protected:
// Protected data // Protected data

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso temperaturePhaseChangeTwoPhaseMixtures wclean libso temperaturePhaseChangeTwoPhaseMixtures
wclean wclean

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso phaseChangeTwoPhaseMixtures wclean libso phaseChangeTwoPhaseMixtures
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType phaseChangeTwoPhaseMixtures wmake $targetType phaseChangeTwoPhaseMixtures
wmake $targetType wmake $targetType

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso multiphaseSystem wclean libso multiphaseSystem
wclean libso interfacialModels wclean libso interfacialModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmakeLnInclude interfacialModels wmakeLnInclude interfacialModels
wmake $targetType multiphaseSystem wmake $targetType multiphaseSystem

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso multiphaseMixture wclean libso multiphaseMixture
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType multiphaseMixture wmake $targetType multiphaseMixture
wmake $targetType wmake $targetType

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso phaseSystems wclean libso phaseSystems
wclean libso interfacialModels wclean libso interfacialModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmakeLnInclude interfacialModels wmakeLnInclude interfacialModels
wmakeLnInclude interfacialCompositionModels wmakeLnInclude interfacialCompositionModels

View File

@ -77,11 +77,39 @@ void Foam::AnisothermalPhaseModel<BasePhaseModel>::correctThermo()
} }
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::AnisothermalPhaseModel<BasePhaseModel>::filterPressureWork
(
const tmp<volScalarField>& pressureWork
) const
{
const volScalarField& alpha = *this;
scalar pressureWorkAlphaLimit =
this->thermo_->lookupOrDefault("pressureWorkAlphaLimit", 0.0);
if (pressureWorkAlphaLimit > 0)
{
return
(
max(alpha - pressureWorkAlphaLimit, scalar(0))
/max(alpha - pressureWorkAlphaLimit, pressureWorkAlphaLimit)
)*pressureWork;
}
else
{
return pressureWork;
}
}
template<class BasePhaseModel> template<class BasePhaseModel>
Foam::tmp<Foam::fvScalarMatrix> Foam::tmp<Foam::fvScalarMatrix>
Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn() Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
{ {
const volScalarField& alpha = *this; const volScalarField& alpha = *this;
const volVectorField& U = this->U();
const surfaceScalarField& alphaPhi = this->alphaPhi(); const surfaceScalarField& alphaPhi = this->alphaPhi();
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi(); const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi();
@ -93,7 +121,8 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
tmp<fvScalarMatrix> tEEqn tmp<fvScalarMatrix> tEEqn
( (
fvm::ddt(alpha, this->rho(), he) + fvm::div(alphaRhoPhi, he) fvm::ddt(alpha, this->rho(), he)
+ fvm::div(alphaRhoPhi, he)
- fvm::Sp(contErr, he) - fvm::Sp(contErr, he)
+ fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_) + fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_)
@ -112,13 +141,15 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
// Add the appropriate pressure-work term // Add the appropriate pressure-work term
if (he.name() == this->thermo_->phasePropertyName("e")) if (he.name() == this->thermo_->phasePropertyName("e"))
{ {
tEEqn.ref() += tEEqn.ref() += filterPressureWork
fvc::ddt(alpha)*this->thermo().p() (
+ fvc::div(alphaPhi, this->thermo().p()); fvc::div(fvc::absolute(alphaPhi, alpha, U), this->thermo().p())
+ this->thermo().p()*fvc::ddt(alpha)
);
} }
else if (this->thermo_->dpdt()) else if (this->thermo_->dpdt())
{ {
tEEqn.ref() -= alpha*this->fluid().dpdt(); tEEqn.ref() -= filterPressureWork(alpha*this->fluid().dpdt());
} }
return tEEqn; return tEEqn;

View File

@ -58,6 +58,15 @@ class AnisothermalPhaseModel
volScalarField K_; volScalarField K_;
// Private member functions
//- Optionally filter the pressure work term as the phase-fraction -> 0
tmp<volScalarField> filterPressureWork
(
const tmp<volScalarField>& pressureWork
) const;
public: public:
// Constructors // Constructors

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,12 @@ Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::ReactingPhaseModel
BasePhaseModel(fluid, phaseName, index, false), BasePhaseModel(fluid, phaseName, index, false),
reaction_ reaction_
( (
ReactionType::New(fluid.mesh(), this->name()) ReactionType::New
(
fluid.mesh(),
combustionModel::combustionPropertiesName,
this->name()
)
) )
{ {
this->thermo_ = &reaction_->thermo(); this->thermo_ = &reaction_->thermo();

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso multiphaseSystem wclean libso multiphaseSystem
wclean libso multiphaseCompressibleTurbulenceModels wclean libso multiphaseCompressibleTurbulenceModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType multiphaseSystem wmake $targetType multiphaseSystem
wmake $targetType multiphaseCompressibleTurbulenceModels wmake $targetType multiphaseCompressibleTurbulenceModels

View File

@ -35,6 +35,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
} }
fluid.correctThermo(); fluid.correctThermo();
fluid.correct();
} }

View File

@ -89,9 +89,6 @@ PtrList<surfaceScalarField> phiFs(phases.size());
// --- Pressure corrector loop // --- Pressure corrector loop
while (pimple.correct()) while (pimple.correct())
{ {
// Update continuity errors due to temperature changes
fluid.correct();
volScalarField rho("rho", fluid.rho()); volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with p and the updated densities // Correct p_rgh for consistency with p and the updated densities

View File

@ -77,11 +77,6 @@ int main(int argc, char *argv[])
//#include "pUf/createDDtU.H" //#include "pUf/createDDtU.H"
int nEnergyCorrectors
(
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -90,6 +85,11 @@ int main(int argc, char *argv[])
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
int nEnergyCorrectors
(
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
);
if (LTS) if (LTS)
{ {
#include "setRDeltaT.H" #include "setRDeltaT.H"

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso twoPhaseSystem wclean libso twoPhaseSystem
wclean libso twoPhaseCompressibleTurbulenceModels wclean libso twoPhaseCompressibleTurbulenceModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType twoPhaseSystem wmake $targetType twoPhaseSystem
wmake $targetType twoPhaseCompressibleTurbulenceModels wmake $targetType twoPhaseCompressibleTurbulenceModels

View File

@ -29,36 +29,25 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
} }
{ {
tmp<fvScalarMatrix> E2eqn(phase2.heEqn()); tmp<fvScalarMatrix> E2Eqn(phase2.heEqn());
if (E2eqn.valid()) if (E2Eqn.valid())
{ {
E2eqn = E2Eqn =
( (
E2eqn E2Eqn
== ==
*heatTransfer[phase2.name()] *heatTransfer[phase2.name()]
+ alpha2*rho2*(U2&g) + alpha2*rho2*(U2&g)
+ fvOptions(alpha2, rho2, phase2.thermo().he()) + fvOptions(alpha2, rho2, phase2.thermo().he())
); );
E2eqn->relax(); E2Eqn->relax();
fvOptions.constrain(E2eqn.ref()); fvOptions.constrain(E2Eqn.ref());
E2eqn->solve(); E2Eqn->solve();
} }
} }
fluid.correctThermo(); fluid.correctThermo();
fluid.correct();
} }
Info<< phase1.name() << " min/max T "
<< min(phase1.thermo().T()).value()
<< " - "
<< max(phase1.thermo().T()).value()
<< endl;
Info<< phase2.name() << " min/max T "
<< min(phase2.thermo().T()).value()
<< " - "
<< max(phase2.thermo().T()).value()
<< endl;

View File

@ -0,0 +1,21 @@
tmp<surfaceScalarField> trDeltaTf;
if (LTS && faceMomentum)
{
trDeltaTf = tmp<surfaceScalarField>
(
new surfaceScalarField
(
IOobject
(
fv::localEulerDdt::rDeltaTfName,
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("one", dimless/dimTime, 1)
)
);
}

View File

@ -83,9 +83,6 @@ tmp<surfaceScalarField> phiF2;
// --- Pressure corrector loop // --- Pressure corrector loop
while (pimple.correct()) while (pimple.correct())
{ {
// Update continuity errors due to temperature changes
fluid.correct();
volScalarField rho("rho", fluid.rho()); volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with p and the updated densities // Correct p_rgh for consistency with p and the updated densities

View File

@ -1,9 +1,2 @@
ddtPhi1 = ddtPhi1 = fvc::ddt(phi1);
( ddtPhi2 = fvc::ddt(phi2);
(phi1 - phi1.oldTime())/runTime.deltaT()
);
ddtPhi2 =
(
(phi2 - phi2.oldTime())/runTime.deltaT()
);

View File

@ -1,9 +1,2 @@
surfaceScalarField ddtPhi1 surfaceScalarField ddtPhi1(fvc::ddt(phi1));
( surfaceScalarField ddtPhi2(fvc::ddt(phi2));
(phi1 - phi1.oldTime())/runTime.deltaT()
);
surfaceScalarField ddtPhi2
(
(phi2 - phi2.oldTime())/runTime.deltaT()
);

View File

@ -32,10 +32,10 @@ surfaceScalarField rAUf1
IOobject::groupName("rAUf", phase1.name()), IOobject::groupName("rAUf", phase1.name()),
1.0 1.0
/( /(
(alphaRhof10 + Vmf)/runTime.deltaT() byDt(alphaRhof10 + Vmf)
+ fvc::interpolate(U1Eqn.A()) + fvc::interpolate(U1Eqn.A())
+ Kdf + Kdf
) )
); );
surfaceScalarField rAUf2 surfaceScalarField rAUf2
@ -43,10 +43,10 @@ surfaceScalarField rAUf2
IOobject::groupName("rAUf", phase2.name()), IOobject::groupName("rAUf", phase2.name()),
1.0 1.0
/( /(
(alphaRhof20 + Vmf)/runTime.deltaT() byDt(alphaRhof20 + Vmf)
+ fvc::interpolate(U2Eqn.A()) + fvc::interpolate(U2Eqn.A())
+ Kdf + Kdf
) )
); );
@ -93,9 +93,6 @@ tmp<surfaceScalarField> Ff2;
while (pimple.correct()) while (pimple.correct())
{ {
// Update continuity errors due to temperature changes
fluid.correct();
volScalarField rho("rho", fluid.rho()); volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with p and the updated densities // Correct p_rgh for consistency with p and the updated densities
@ -160,7 +157,7 @@ while (pimple.correct())
rAUf1 rAUf1
*( *(
(alphaRhof10 + Vmf) (alphaRhof10 + Vmf)
*MRF.absolute(phi1.oldTime())/runTime.deltaT() *byDt(MRF.absolute(phi1.oldTime()))
+ fvc::flux(U1Eqn.H()) + fvc::flux(U1Eqn.H())
+ Vmf*ddtPhi2 + Vmf*ddtPhi2
+ Kdf*MRF.absolute(phi2) + Kdf*MRF.absolute(phi2)
@ -178,7 +175,7 @@ while (pimple.correct())
rAUf2 rAUf2
*( *(
(alphaRhof20 + Vmf) (alphaRhof20 + Vmf)
*MRF.absolute(phi2.oldTime())/runTime.deltaT() *byDt(MRF.absolute(phi2.oldTime()))
+ fvc::flux(U2Eqn.H()) + fvc::flux(U2Eqn.H())
+ Vmf*ddtPhi1 + Vmf*ddtPhi1
+ Kdf*MRF.absolute(phi1) + Kdf*MRF.absolute(phi1)

View File

@ -43,6 +43,22 @@ Description
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
namespace Foam
{
tmp<surfaceScalarField> byDt(const surfaceScalarField& sf)
{
if (fv::localEulerDdt::enabled(sf.mesh()))
{
return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf;
}
else
{
return sf/sf.mesh().time().deltaT();
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -76,13 +92,9 @@ int main(int argc, char *argv[])
) )
); );
#include "createRDeltaTf.H"
#include "pUf/createDDtU.H" #include "pUf/createDDtU.H"
int nEnergyCorrectors
(
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -91,9 +103,18 @@ int main(int argc, char *argv[])
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
int nEnergyCorrectors
(
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
);
if (LTS) if (LTS)
{ {
#include "setRDeltaT.H" #include "setRDeltaT.H"
if (faceMomentum)
{
#include "setRDeltaTf.H"
}
} }
else else
{ {

View File

@ -0,0 +1 @@
trDeltaTf.ref() = fvc::interpolate(fv::localEulerDdt::localRDeltaT(mesh));

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso twoPhaseSystem wclean libso twoPhaseSystem
wclean libso interfacialModels wclean libso interfacialModels

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmakeLnInclude interfacialModels wmakeLnInclude interfacialModels
wmake $targetType twoPhaseSystem wmake $targetType twoPhaseSystem

View File

@ -16,7 +16,8 @@
- contErr1*K1 - contErr1*K1
+ ( + (
he1.name() == thermo1.phasePropertyName("e") he1.name() == thermo1.phasePropertyName("e")
? fvc::ddt(alpha1)*p + fvc::div(alphaPhi1, p) ? fvc::div(fvc::absolute(alphaPhi1, alpha1, U1), p)
+ p*fvc::ddt(alpha1)
: -alpha1*dpdt : -alpha1*dpdt
) )
@ -48,7 +49,8 @@
- contErr2*K2 - contErr2*K2
+ ( + (
he2.name() == thermo2.phasePropertyName("e") he2.name() == thermo2.phasePropertyName("e")
? fvc::ddt(alpha2)*p + fvc::div(alphaPhi2, p) ? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p)
+ p*fvc::ddt(alpha1)
: -alpha2*dpdt : -alpha2*dpdt
) )

View File

@ -248,4 +248,30 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties)
} }
void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
// 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];
}
}
}
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -319,6 +319,9 @@ public:
return alphaRhoPhi_; return alphaRhoPhi_;
} }
//- Ensure that the flux at inflow BCs is preserved
void correctInflowFlux(surfaceScalarField& alphaPhi) const;
//- Correct the phase properties //- Correct the phase properties
// other than the thermodynamics and turbulence // other than the thermodynamics and turbulence
// which have special treatment // which have special treatment

View File

@ -444,28 +444,7 @@ void Foam::twoPhaseSystem::solve()
) )
); );
surfaceScalarField::Boundary& alphaPhic1Bf = phase1_.correctInflowFlux(alphaPhic1);
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];
}
}
}
}
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)
{ {
@ -537,6 +516,7 @@ void Foam::twoPhaseSystem::solve()
phase2_.alphaPhi() = phi_ - phase1_.alphaPhi(); phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
alpha2 = scalar(1) - alpha1; alpha2 = scalar(1) - alpha1;
phase2_.correctInflowFlux(phase2_.alphaPhi());
phase2_.alphaRhoPhi() = phase2_.alphaRhoPhi() =
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();

View File

@ -76,9 +76,8 @@ void printRegistry
Foam::label indent Foam::label indent
) )
{ {
hashedWordList regs = obr.names<objectRegistry>();
regs.sort();
wordList names = obr.sortedNames(); wordList names = obr.sortedNames();
hashedWordList regs = obr.sortedNames<objectRegistry>();
std::string prefix; std::string prefix;
for (label i=indent; i; --i) for (label i=indent; i; --i)
@ -121,7 +120,8 @@ void printRegistry
const word& name = regs[i]; const word& name = regs[i];
const objectRegistry& next = obr.lookupObject<objectRegistry> const objectRegistry& next = obr.lookupObject<objectRegistry>
( (
name name,
recursive
); );
os << prefix.c_str() os << prefix.c_str()
@ -158,13 +158,13 @@ int main(int argc, char *argv[])
"skip", "skip",
"skip some parts" "skip some parts"
); );
// argList::validArgs.append("recursive (true|false)"); argList::validArgs.append("recursive (true|false)");
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createPolyMesh.H" #include "createPolyMesh.H"
// recursive = Switch(args[1]); recursive = Switch(args[1]);
const bool optMesh = args.optionFound("mesh"); const bool optMesh = args.optionFound("mesh");
const bool optSkip = args.optionFound("skip"); const bool optSkip = args.optionFound("skip");
@ -183,7 +183,8 @@ int main(int argc, char *argv[])
db.subRegistry db.subRegistry
( (
entryName, entryName,
true true,
recursive
); );
} }
@ -200,7 +201,8 @@ int main(int argc, char *argv[])
const objectRegistry& subreg = db.subRegistry const objectRegistry& subreg = db.subRegistry
( (
regName, regName,
true true,
recursive
); );
for (label j = 0; j < 3; ++j) for (label j = 0; j < 3; ++j)
@ -210,12 +212,14 @@ int main(int argc, char *argv[])
subreg.subRegistry subreg.subRegistry
( (
entryName, entryName,
true true,
recursive
); );
subreg.subRegistry subreg.subRegistry
( (
"$" + entryName, // qualified to avoid collisions "$" + entryName, // qualified to avoid collisions
true true,
recursive
); );
} }
} }
@ -231,7 +235,8 @@ int main(int argc, char *argv[])
db.subRegistry db.subRegistry
( (
entryName, entryName,
true true,
recursive
); );
} }
@ -249,7 +254,8 @@ int main(int argc, char *argv[])
const objectRegistry& subreg = db.subRegistry const objectRegistry& subreg = db.subRegistry
( (
regName, regName,
false false,
recursive
); );
if (!optSkip) if (!optSkip)
@ -261,7 +267,8 @@ int main(int argc, char *argv[])
subreg.subRegistry subreg.subRegistry
( (
entryName, entryName,
true true,
recursive
); );
} }
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -56,7 +56,9 @@ Description
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "faceSet.H" #include "faceSet.H"
#include "cellSet.H" #include "cellSet.H"
#include "pointSet.H"
#include "syncTools.H" #include "syncTools.H"
#include "ReadFields.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "polyModifyFace.H" #include "polyModifyFace.H"
#include "polyAddFace.H" #include "polyAddFace.H"
@ -315,6 +317,59 @@ void initCreatedPatches
} }
template<class TopoSet>
void subsetTopoSets
(
const fvMesh& mesh,
const IOobjectList& objectsList,
const labelList& map,
const fvMesh& subMesh,
PtrList<TopoSet>& subSets
)
{
// Read original sets
PtrList<TopoSet> sets;
ReadFields<TopoSet>(objectsList, sets);
subSets.setSize(sets.size());
forAll(sets, i)
{
TopoSet& set = sets[i];
Info<< "Subsetting " << set.type() << " " << set.name() << endl;
// Map the data
PackedBoolList isSet(set.maxSize(mesh));
forAllConstIter(labelHashSet, set, iter)
{
isSet[iter.key()] = true;
}
label nSet = 0;
forAll(map, i)
{
if (isSet[map[i]])
{
nSet++;
}
}
subSets.set
(
i,
new TopoSet(subMesh, set.name(), nSet, IOobject::AUTO_WRITE)
);
TopoSet& subSet = subSets[i];
forAll(map, i)
{
if (isSet[map[i]])
{
subSet.insert(i);
}
}
}
}
void createCoupledBaffles void createCoupledBaffles
( (
fvMesh& mesh, fvMesh& mesh,
@ -923,6 +978,41 @@ int main(int argc, char *argv[])
surfTensorFlds surfTensorFlds
); );
// Set handling
PtrList<cellSet> cellSets;
PtrList<faceSet> faceSets;
PtrList<pointSet> pointSets;
{
IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets");
subsetTopoSets
(
mesh,
objects,
subsetter.cellMap(),
subsetter.subMesh(),
cellSets
);
subsetTopoSets
(
mesh,
objects,
subsetter.faceMap(),
subsetter.subMesh(),
faceSets
);
subsetTopoSets
(
mesh,
objects,
subsetter.pointMap(),
subsetter.subMesh(),
pointSets
);
}
if (!overwrite) if (!overwrite)
{ {
runTime++; runTime++;
@ -1134,6 +1224,11 @@ int main(int argc, char *argv[])
Zero Zero
); );
// Update numbering of topoSets
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, cellSets);
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, faceSets);
topoSet::updateMesh(subsetter.subMesh().facesInstance(), map, pointSets);
// Move mesh (since morphing might not do this) // Move mesh (since morphing might not do this)
if (map().hasMotionPoints()) if (map().hasMotionPoints())

View File

@ -1,9 +1,11 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lreconstruct \
-ldynamicMesh -ldynamicMesh

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -60,6 +60,8 @@ Description
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "unitConversion.H" #include "unitConversion.H"
#include "motionSmoother.H" #include "motionSmoother.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -450,6 +452,8 @@ int main(int argc, char *argv[])
Info<< "Writing morphed mesh to time " << runTime.timeName() << endl; Info<< "Writing morphed mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
} }
else else
{ {

View File

@ -1,7 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-lreconstruct \
-ldynamicMesh -ldynamicMesh

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -62,6 +62,8 @@ Description
#include "meshTools.H" #include "meshTools.H"
#include "Pair.H" #include "Pair.H"
#include "globalIndex.H" #include "globalIndex.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -567,6 +569,8 @@ int main(int argc, char *argv[])
// Write resulting mesh // Write resulting mesh
Info<< "Writing modified mesh to time " << runTime.timeName() << endl; Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
} }
else if (edgeToPos.size()) else if (edgeToPos.size())
{ {
@ -641,6 +645,8 @@ int main(int argc, char *argv[])
// Write resulting mesh // Write resulting mesh
Info<< "Writing modified mesh to time " << runTime.timeName() << endl; Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
} }
else else
{ {
@ -684,6 +690,8 @@ int main(int argc, char *argv[])
// Write resulting mesh // Write resulting mesh
Info<< "Writing modified mesh to time " << runTime.timeName() << endl; Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
} }

View File

@ -1,11 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lreconstruct \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools \
-lfiniteVolume \
-lgenericPatchFields -lgenericPatchFields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -49,6 +49,7 @@ Description
#include "surfaceFields.H" #include "surfaceFields.H"
#include "pointFields.H" #include "pointFields.H"
#include "ReadFields.H" #include "ReadFields.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -197,6 +198,8 @@ int main(int argc, char *argv[])
mesh.write(); mesh.write();
meshCutter.write(); meshCutter.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,7 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lmeshTools -lmeshTools

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -53,6 +53,7 @@ Description
#include "cellCuts.H" #include "cellCuts.H"
#include "cellSet.H" #include "cellSet.H"
#include "meshCutter.H" #include "meshCutter.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -257,6 +258,8 @@ int main(int argc, char *argv[])
Info<< "Writing refined mesh to time " << runTime.timeName() << endl; Info<< "Writing refined mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,10 +1,12 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
-lfiniteVolume \ -lfiniteVolume \
-lreconstruct \
-lgenericPatchFields -lgenericPatchFields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,6 +44,7 @@ Description
#include "ReadFields.H" #include "ReadFields.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -179,6 +180,8 @@ int main(int argc, char *argv[])
// Take over refinement levels and write to new time directory. // Take over refinement levels and write to new time directory.
Pout<< "Writing mesh to time " << runTime.timeName() << endl; Pout<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Pout<< "End\n" << endl; Pout<< "End\n" << endl;

View File

@ -11,7 +11,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/etc/config.sh/functions . $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
set -x
# Build libccmio (.a|.so) # Build libccmio (.a|.so)
$WM_THIRD_PARTY_DIR/makeCCMIO lib # libso $WM_THIRD_PARTY_DIR/makeCCMIO lib # libso

View File

@ -4,6 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/mesh/extrudeModel/lnInclude -I$(LIB_SRC)/mesh/extrudeModel/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -11,4 +12,5 @@ EXE_LIBS = \
-lsurfMesh \ -lsurfMesh \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lextrudeModel -lextrudeModel

View File

@ -56,6 +56,7 @@ Description
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
#include "planeExtrusion.H" #include "planeExtrusion.H"
#include "emptyPolyPatch.H" #include "emptyPolyPatch.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -1058,6 +1059,8 @@ int main(int argc, char *argv[])
FatalErrorInFunction FatalErrorInFunction
<< exit(FatalError); << exit(FatalError);
} }
// Remove any left-over files
processorMeshes::removeFiles(mesh);
// Need writing cellSet // Need writing cellSet
label nAdded = returnReduce(addedCellsSet.size(), sumOp<label>()); label nAdded = returnReduce(addedCellsSet.size(), sumOp<label>());

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/mesh/extrudeModel/lnInclude -I$(LIB_SRC)/mesh/extrudeModel/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -10,4 +11,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lextrudeModel -lextrudeModel

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -141,6 +141,7 @@ Notes:
#include "fvMeshTools.H" #include "fvMeshTools.H"
#include "OBJstream.H" #include "OBJstream.H"
#include "PatchTools.H" #include "PatchTools.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -2646,6 +2647,8 @@ int main(int argc, char *argv[])
<< " at location " << regionMesh.facesInstance() << " at location " << regionMesh.facesInstance()
<< exit(FatalError); << exit(FatalError);
} }
topoSet::removeFiles(regionMesh);
processorMeshes::removeFiles(regionMesh);
// See if we need to extrude coordinates as well // See if we need to extrude coordinates as well
@ -2847,6 +2850,8 @@ int main(int argc, char *argv[])
<< " at location " << mesh.facesInstance() << " at location " << mesh.facesInstance()
<< exit(FatalError); << exit(FatalError);
} }
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
} }
Info << "End\n" << endl; Info << "End\n" << endl;

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso extrude2DMesh wclean libso extrude2DMesh
wclean wclean

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType extrude2DMesh wmake $targetType extrude2DMesh
wmake $targetType wmake $targetType

View File

@ -2,11 +2,14 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-Iextrude2DMesh/lnInclude \ -Iextrude2DMesh/lnInclude \
-I$(LIB_SRC)/mesh/extrudeModel/lnInclude -I$(LIB_SRC)/mesh/extrudeModel/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lsurfMesh \ -lsurfMesh \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lextrude2DMesh \ -lextrude2DMesh \
-lextrudeModel -lextrudeModel

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -47,6 +47,8 @@ Note
#include "addPatchCellLayer.H" #include "addPatchCellLayer.H"
#include "patchToPoly2DMesh.H" #include "patchToPoly2DMesh.H"
#include "globalIndex.H" #include "globalIndex.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -323,6 +325,8 @@ int main(int argc, char *argv[])
<< nl << endl; << nl << endl;
mesh().write(); mesh().write();
topoSet::removeFiles(mesh());
processorMeshes::removeFiles(mesh());
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean conformalVoronoiMesh wclean conformalVoronoiMesh
wclean conformalVoronoi2DMesh wclean conformalVoronoi2DMesh

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for compilation (at least for error catching) # Parse arguments for compilation (at least for error catching)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
if [ -d "${FASTDUALOCTREE_SRC_PATH}" ] if [ -d "${FASTDUALOCTREE_SRC_PATH}" ]
then then

View File

@ -9,6 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -22,4 +23,5 @@ EXE_LIBS = \
-lfileFormats \ -lfileFormats \
-ldynamicMesh \ -ldynamicMesh \
-ldecompose \ -ldecompose \
-lreconstruct \
-lsnappyHexMesh -lsnappyHexMesh

View File

@ -63,6 +63,7 @@ Description
#include "decompositionModel.H" #include "decompositionModel.H"
#include "fvMeshTools.H" #include "fvMeshTools.H"
#include "profiling.H" #include "profiling.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -658,6 +659,13 @@ void writeMesh
meshRefiner.printMeshInfo(debugLevel, msg); meshRefiner.printMeshInfo(debugLevel, msg);
Info<< "Writing mesh to time " << meshRefiner.timeName() << endl; Info<< "Writing mesh to time " << meshRefiner.timeName() << endl;
processorMeshes::removeFiles(mesh);
if (!debugLevel)
{
topoSet::removeFiles(mesh);
}
refinementHistory::removeFiles(mesh);
//label flag = meshRefinement::MESH; //label flag = meshRefinement::MESH;
//if (writeLevel) //if (writeLevel)
//{ //{

View File

@ -2,10 +2,12 @@ EXE_INC = \
-IfaceSelection \ -IfaceSelection \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lreconstruct \
-lgenericPatchFields -lgenericPatchFields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -53,6 +53,8 @@ Description
#include "faceSelection.H" #include "faceSelection.H"
#include "fvMeshTools.H" #include "fvMeshTools.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -978,6 +980,8 @@ int main(int argc, char *argv[])
Info<< "Writing mesh to " << runTime.timeName() << endl; Info<< "Writing mesh to " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,7 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lmeshTools -lmeshTools

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -52,6 +52,7 @@ Description
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "polyModifyFace.H" #include "polyModifyFace.H"
#include "wordReList.H" #include "wordReList.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -900,6 +901,8 @@ int main(int argc, char *argv[])
// Write resulting mesh // Write resulting mesh
Info<< "Writing repatched mesh to " << runTime.timeName() << nl << endl; Info<< "Writing repatched mesh to " << runTime.timeName() << nl << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,6 +1,9 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lreconstruct

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -35,6 +35,8 @@ Description
#include "argList.H" #include "argList.H"
#include "Time.H" #include "Time.H"
#include "mergePolyMesh.H" #include "mergePolyMesh.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -163,6 +165,8 @@ int main(int argc, char *argv[])
} }
masterMesh.write(); masterMesh.write();
topoSet::removeFiles(masterMesh);
processorMeshes::removeFiles(masterMesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -1,10 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-lmeshTools \ -lreconstruct \
-ldynamicMesh -ldynamicMesh

View File

@ -79,6 +79,7 @@ Note
#include "ReadFields.H" #include "ReadFields.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -537,6 +538,8 @@ int main(int argc, char *argv[])
Info<< "Writing mesh to time " << runTime.timeName() << endl; Info<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
// Dump duplicated points (if any) // Dump duplicated points (if any)
const labelList& pointMap = map().pointMap(); const labelList& pointMap = map().pointMap();

View File

@ -1,10 +1,12 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lmeshTools -lmeshTools

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -74,6 +74,8 @@ Note
#include "ReadFields.H" #include "ReadFields.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "topoSet.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -552,6 +554,8 @@ int main(int argc, char *argv[])
Info<< "Writing dual mesh to " << runTime.timeName() << endl; Info<< "Writing dual mesh to " << runTime.timeName() << endl;
mesh.write(); mesh.write();
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -6,7 +6,8 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/renumber/renumberMethods/lnInclude \ -I$(LIB_SRC)/renumber/renumberMethods/lnInclude \
-I$(LIB_SRC)/renumber/zoltanRenumber/lnInclude \ -I$(LIB_SRC)/renumber/zoltanRenumber/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
@ -14,5 +15,6 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-lrenumberMethods \ -lrenumberMethods \
-lreconstruct \
$(LINK_FLAGS) \ $(LINK_FLAGS) \
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -52,6 +52,8 @@ Description
#include "cellSet.H" #include "cellSet.H"
#include "faceSet.H" #include "faceSet.H"
#include "pointSet.H" #include "pointSet.H"
#include "processorMeshes.H"
#include "hexRef8.H"
#ifdef FOAM_USE_ZOLTAN #ifdef FOAM_USE_ZOLTAN
#include "zoltanRenumber.H" #include "zoltanRenumber.H"
@ -696,7 +698,6 @@ int main(int argc, char *argv[])
bool writeMaps = false; bool writeMaps = false;
bool orderPoints = false; bool orderPoints = false;
label blockSize = 0; label blockSize = 0;
bool renumberSets = true;
// Construct renumberMethod // Construct renumberMethod
autoPtr<IOdictionary> renumberDictPtr; autoPtr<IOdictionary> renumberDictPtr;
@ -756,8 +757,6 @@ int main(int argc, char *argv[])
Info<< "Writing renumber maps (new to old) to polyMesh." << nl Info<< "Writing renumber maps (new to old) to polyMesh." << nl
<< endl; << endl;
} }
renumberSets = renumberDict.lookupOrDefault("renumberSets", true);
} }
else else
{ {
@ -884,46 +883,12 @@ int main(int argc, char *argv[])
PtrList<cellSet> cellSets; PtrList<cellSet> cellSets;
PtrList<faceSet> faceSets; PtrList<faceSet> faceSets;
PtrList<pointSet> pointSets; PtrList<pointSet> pointSets;
if (renumberSets)
{ {
// Read sets // Read sets
IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets"); IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets");
{ ReadFields(objects, cellSets);
IOobjectList cSets(objects.lookupClass(cellSet::typeName)); ReadFields(objects, faceSets);
if (cSets.size()) ReadFields(objects, pointSets);
{
Info<< "Reading cellSets:" << endl;
forAllConstIter(IOobjectList, cSets, iter)
{
cellSets.append(new cellSet(*iter()));
Info<< " " << cellSets.last().name() << endl;
}
}
}
{
IOobjectList fSets(objects.lookupClass(faceSet::typeName));
if (fSets.size())
{
Info<< "Reading faceSets:" << endl;
forAllConstIter(IOobjectList, fSets, iter)
{
faceSets.append(new faceSet(*iter()));
Info<< " " << faceSets.last().name() << endl;
}
}
}
{
IOobjectList pSets(objects.lookupClass(pointSet::typeName));
if (pSets.size())
{
Info<< "Reading pointSets:" << endl;
forAllConstIter(IOobjectList, pSets, iter)
{
pointSets.append(new pointSet(*iter()));
Info<< " " << pointSets.last().name() << endl;
}
}
}
} }
@ -1183,6 +1148,7 @@ int main(int argc, char *argv[])
} }
// Move mesh (since morphing might not do this) // Move mesh (since morphing might not do this)
if (map().hasMotionPoints()) if (map().hasMotionPoints())
{ {
@ -1288,9 +1254,20 @@ int main(int argc, char *argv[])
{ {
mesh.setInstance(oldInstance); mesh.setInstance(oldInstance);
} }
else
{
mesh.setInstance(runTime.timeName());
}
Info<< "Writing mesh to " << mesh.facesInstance() << endl; Info<< "Writing mesh to " << mesh.facesInstance() << endl;
processorMeshes::removeFiles(mesh);
hexRef8::removeFiles(mesh);
topoSet::updateMesh(mesh.facesInstance(), map(), cellSets);
topoSet::updateMesh(mesh.facesInstance(), map(), faceSets);
topoSet::updateMesh(mesh.facesInstance(), map(), pointSets);
mesh.write(); mesh.write();
if (cellProcAddressing.headerOk()) if (cellProcAddressing.headerOk())
@ -1437,27 +1414,6 @@ int main(int argc, char *argv[])
).write(); ).write();
} }
if (renumberSets)
{
forAll(cellSets, i)
{
cellSets[i].updateMesh(map());
cellSets[i].instance() = mesh.facesInstance();
cellSets[i].write();
}
forAll(faceSets, i)
{
faceSets[i].updateMesh(map());
faceSets[i].instance() = mesh.facesInstance();
faceSets[i].write();
}
forAll(pointSets, i)
{
pointSets[i].updateMesh(map());
pointSets[i].instance() = mesh.facesInstance();
pointSets[i].write();
}
}
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -34,9 +34,6 @@ sortCoupledFaceCells false;
// Optional entry: sort points into internal and boundary points // Optional entry: sort points into internal and boundary points
//orderPoints false; //orderPoints false;
// Optional: suppress renumbering cellSets,faceSets,pointSets
//renumberSets false;
method CuthillMcKee; method CuthillMcKee;
//method Sloan; //method Sloan;

View File

@ -11,7 +11,7 @@ unset COMP_FLAGS LINK_FLAGS
# #
if [ -f /usr/include/readline/readline.h ] if [ -f /usr/include/readline/readline.h ]
then then
echo "Found <readline/readline.h> -- enabling readline support." echo " found <readline/readline.h> -- enabling readline support."
export COMP_FLAGS="-DHAS_READLINE" export COMP_FLAGS="-DHAS_READLINE"
export LINK_FLAGS="-lreadline" export LINK_FLAGS="-lreadline"
fi fi

View File

@ -1,7 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lreconstruct \
-lmeshTools -lmeshTools

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -56,6 +56,7 @@ Description
#include "attachPolyTopoChanger.H" #include "attachPolyTopoChanger.H"
#include "regionSide.H" #include "regionSide.H"
#include "primitiveFacePatch.H" #include "primitiveFacePatch.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -287,6 +288,9 @@ int main(int argc, char *argv[])
<< "Failed writing polyMesh." << "Failed writing polyMesh."
<< exit(FatalError); << exit(FatalError);
} }
topoSet::removeFiles(mesh);
processorMeshes::removeFiles(mesh);
Info<< nl << "End" << nl << endl; Info<< nl << "End" << nl << endl;

View File

@ -1,10 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lreconstruct \
-lgenericPatchFields \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lgenericPatchFields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -107,6 +107,7 @@ Description
#include "mappedWallPolyPatch.H" #include "mappedWallPolyPatch.H"
#include "fvMeshTools.H" #include "fvMeshTools.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -941,6 +942,8 @@ void createAndWriteRegion
newMesh().setInstance(newMeshInstance); newMesh().setInstance(newMeshInstance);
newMesh().write(); newMesh().write();
topoSet::removeFiles(newMesh());
processorMeshes::removeFiles(newMesh());
// Write addressing files like decomposePar // Write addressing files like decomposePar
Info<< "Writing addressing to base mesh" << endl; Info<< "Writing addressing to base mesh" << endl;

View File

@ -1,9 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-ldynamicMesh \ -lreconstruct \
-lgenericPatchFields -lgenericPatchFields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,11 +41,15 @@ Description
#include "fvMeshSubset.H" #include "fvMeshSubset.H"
#include "argList.H" #include "argList.H"
#include "cellSet.H"
#include "IOobjectList.H" #include "IOobjectList.H"
#include "volFields.H" #include "volFields.H"
#include "topoDistanceData.H" #include "topoDistanceData.H"
#include "FaceCellWave.H" #include "FaceCellWave.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "ReadFields.H"
#include "processorMeshes.H"
using namespace Foam; using namespace Foam;
@ -262,6 +266,59 @@ void subsetDimensionedFields
} }
template<class TopoSet>
void subsetTopoSets
(
const fvMesh& mesh,
const IOobjectList& objectsList,
const labelList& map,
const fvMesh& subMesh,
PtrList<TopoSet>& subSets
)
{
// Read original sets
PtrList<TopoSet> sets;
ReadFields<TopoSet>(objectsList, sets);
subSets.setSize(sets.size());
forAll(sets, i)
{
TopoSet& set = sets[i];
Info<< "Subsetting " << set.type() << " " << set.name() << endl;
// Map the data
PackedBoolList isSet(set.maxSize(mesh));
forAllConstIter(labelHashSet, set, iter)
{
isSet[iter.key()] = true;
}
label nSet = 0;
forAll(map, i)
{
if (isSet[map[i]])
{
nSet++;
}
}
subSets.set
(
i,
new TopoSet(subMesh, set.name(), nSet, IOobject::AUTO_WRITE)
);
TopoSet& subSet = subSets[i];
forAll(map, i)
{
if (isSet[map[i]])
{
subSet.insert(i);
}
}
}
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -557,6 +614,43 @@ int main(int argc, char *argv[])
subsetDimensionedFields(subsetter, tensorDimNames, tensorDimFlds); subsetDimensionedFields(subsetter, tensorDimNames, tensorDimFlds);
// topoSets and subset
// ~~~~~~~~~~~~~~~~~~~
PtrList<cellSet> cellSets;
PtrList<faceSet> faceSets;
PtrList<pointSet> pointSets;
{
IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets");
objects.remove(currentSet);
subsetTopoSets
(
mesh,
objects,
subsetter.cellMap(),
subsetter.subMesh(),
cellSets
);
subsetTopoSets
(
mesh,
objects,
subsetter.faceMap(),
subsetter.subMesh(),
faceSets
);
subsetTopoSets
(
mesh,
objects,
subsetter.pointMap(),
subsetter.subMesh(),
pointSets
);
}
// Write mesh and fields to new time // Write mesh and fields to new time
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -564,15 +658,22 @@ int main(int argc, char *argv[])
{ {
runTime.setTime(instant(fieldsInstance), 0); runTime.setTime(instant(fieldsInstance), 0);
subsetter.subMesh().setInstance(meshInstance); subsetter.subMesh().setInstance(meshInstance);
topoSet::setInstance(meshInstance, cellSets);
topoSet::setInstance(meshInstance, faceSets);
topoSet::setInstance(meshInstance, pointSets);
} }
else else
{ {
runTime++; runTime++;
subsetter.subMesh().setInstance(runTime.timeName());
} }
Info<< "Writing subsetted mesh and fields to time " << runTime.timeName() Info<< "Writing subsetted mesh and fields to time " << runTime.timeName()
<< endl; << endl;
subsetter.subMesh().write(); subsetter.subMesh().write();
processorMeshes::removeFiles(subsetter.subMesh());
// Subsetting adds 'subset' prefix. Rename field to be like original. // Subsetting adds 'subset' prefix. Rename field to be like original.

View File

@ -36,9 +36,6 @@ Description
#include "Time.H" #include "Time.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "topoSetSource.H" #include "topoSetSource.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "timeSelector.H" #include "timeSelector.H"
#include "IOobjectList.H" #include "IOobjectList.H"

View File

@ -342,8 +342,12 @@ FoamFile
// //
// cellZoneSet // cellZoneSet
// ~~~~~~~~~~~ // ~~~~~~~~~~~
// (mirrors operations on a cellSet into a cellZone) // Manipulates a cellZone (as well as a cellSet)
// Takes any cellSet source. The difference with a cellSet is
// - reads the cells from the cellZone, not the cellSet
// - write to the cellZone as well as the cellSet
// //
// For backwards compatibility:
// // Select based on cellSet // // Select based on cellSet
// source setToCellZone; // source setToCellZone;
// sourceInfo // sourceInfo
@ -355,6 +359,9 @@ FoamFile
// //
// faceZoneSet // faceZoneSet
// ~~~~~~~~~~~ // ~~~~~~~~~~~
// Manipulates a faceZone (as well as a faceSet). It can only be used
// with two special sources:
//
// // Select based on faceSet without orientation // // Select based on faceSet without orientation
// source setToFaceZone; // source setToFaceZone;
// sourceInfo // sourceInfo
@ -394,17 +401,19 @@ FoamFile
// //
// pointZoneSet // pointZoneSet
// ~~~~~~~~~~~~ // ~~~~~~~~~~~~
// (mirrors operations on a pointSet into a pointZone) // Manipulates a pointZone (as well as a pointSet)
// Takes any pointSet source. The difference with a pointSet is
// - reads the cells from the pointZone, not the pointSet
// - write to the pointZone as well as the pointSet
// //
// For backwards compatibility:
// // Select based on pointSet // // Select based on pointSet
// source setToPointZone; // source setToPointZone;
// sourceInfo // sourceInfo
// { // {
// set p0; // name of pointSet // set p0; // name of pointSet
// } // }
//
//
//
actions actions
( (
@ -465,6 +474,19 @@ actions
option all; option all;
} }
} }
// Example: create cellZone from geometric region
{
name c0;
type cellZoneSet;
action new;
source boxToCell;
sourceInfo
{
box (0.04 0 0)(0.06 100 100);
}
}
); );
// ************************************************************************* // // ************************************************************************* //

View File

@ -57,6 +57,9 @@ Usage
- \par -includes - \par -includes
List the \c #include and \c #includeIfPresent files to standard output List the \c #include and \c #includeIfPresent files to standard output
- \par -disableFunctionEntries
Do not expand macros or directives (#include etc)
Example usage: Example usage:
- Change simulation to run for one timestep only: - Change simulation to run for one timestep only:
\verbatim \verbatim
@ -97,6 +100,15 @@ Usage
-entry boundaryField -entry boundaryField
\endverbatim \endverbatim
- Change patch type:
\verbatim
foamDictionary constant/polyMesh/boundary \
-entry entry0.fixedWalls.type -set patch
\endverbatim
This uses special parsing of Lists which stores these in the
dictionary with keyword 'entryDDD' where DDD is the position
in the dictionary (after ignoring the FoamFile entry).
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H" #include "argList.H"
@ -271,6 +283,11 @@ int main(int argc, char *argv[])
"Read the specified dictionary file, expand the macros etc. and write " "Read the specified dictionary file, expand the macros etc. and write "
"the resulting dictionary to standard output" "the resulting dictionary to standard output"
); );
argList::addBoolOption
(
"disableFunctionEntries",
"Disable expansion of dictionary directives - #include, #codeStream etc"
);
argList args(argc, argv); argList args(argc, argv);
@ -281,6 +298,15 @@ int main(int argc, char *argv[])
Foam::functionEntries::includeEntry::log = true; Foam::functionEntries::includeEntry::log = true;
} }
const bool disableEntries = args.optionFound("disableFunctionEntries");
if (disableEntries)
{
Info<< "Not expanding variables or dictionary directives"
<< endl;
entry::disableFunctionEntries = true;
}
fileName dictFileName(args[1]); fileName dictFileName(args[1]);
autoPtr<IFstream> dictFile(new IFstream(dictFileName)); autoPtr<IFstream> dictFile(new IFstream(dictFileName));
@ -460,7 +486,7 @@ int main(int argc, char *argv[])
{ {
FatalIOErrorInFunction(dictFile) FatalIOErrorInFunction(dictFile)
<< "Cannot find entry " << entryName << "Cannot find entry " << entryName
<< exit(FatalError, 2); << exit(FatalIOError, 2);
} }
} }
} }

View File

@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType helpTypes wmake $targetType helpTypes
wmake $targetType wmake $targetType

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
@ -16,11 +17,8 @@ EXE_LIBS = \
-lcoalCombustion \ -lcoalCombustion \
-lcombustionModels \ -lcombustionModels \
-lcompressibleEulerianInterfacialModels \ -lcompressibleEulerianInterfacialModels \
-lcompressibleMultiphaseEulerianInterfacialModels \
-lcompressibleTurbulenceModels \ -lcompressibleTurbulenceModels \
-lCompressibleTwoPhaseMixtureTurbulenceModels \ -lCompressibleTwoPhaseMixtureTurbulenceModels \
-lcompressibleTwoPhaseSystem \
-lconformalVoronoiMesh \
-ldecompositionMethods \ -ldecompositionMethods \
-ldistributed \ -ldistributed \
-ldistributionModels \ -ldistributionModels \
@ -54,12 +52,7 @@ EXE_LIBS = \
-lliquidPropertiesFvPatchFields \ -lliquidPropertiesFvPatchFields \
-lliquidProperties \ -lliquidProperties \
-lmeshTools \ -lmeshTools \
-lmultiphaseInterFoam \
-lmultiphaseMixtureThermo \
-lmultiphaseReactingTurbulenceModels \
-lmultiphaseSystem \
-lODE \ -lODE \
-lOpenFOAM \
-lphaseChangeTwoPhaseMixtures \ -lphaseChangeTwoPhaseMixtures \
-lphaseCompressibleTurbulenceModels \ -lphaseCompressibleTurbulenceModels \
-lphaseTemperatureChangeTwoPhaseMixtures \ -lphaseTemperatureChangeTwoPhaseMixtures \
@ -67,11 +60,6 @@ EXE_LIBS = \
-lpyrolysisModels \ -lpyrolysisModels \
-lradiationModels \ -lradiationModels \
-lrandomProcesses \ -lrandomProcesses \
-lreactingEulerianInterfacialCompositionModels \
-lreactingEulerianInterfacialModels \
-lreactingMultiphaseSystem \
-lreactingPhaseSystem \
-lreactingTwoPhaseSystem \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lregionCoupled \ -lregionCoupled \
-lregionCoupling \ -lregionCoupling \
@ -101,5 +89,4 @@ EXE_LIBS = \
-lturbulenceModelSchemes \ -lturbulenceModelSchemes \
-lturbulenceModels \ -lturbulenceModels \
-ltwoPhaseProperties \ -ltwoPhaseProperties \
-ltwoPhaseReactingTurbulenceModels \
-lutilityFunctionObjects -lutilityFunctionObjects

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -53,6 +53,7 @@ Description
#include "fvMeshAdder.H" #include "fvMeshAdder.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "extrapolatedCalculatedFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
#include "topoSet.H"
using namespace Foam; using namespace Foam;
@ -731,6 +732,7 @@ int main(int argc, char *argv[])
<< "Failed writing polyMesh." << "Failed writing polyMesh."
<< exit(FatalError); << exit(FatalError);
} }
topoSet::removeFiles(masterMesh);
if (writeCellDist) if (writeCellDist)
{ {

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