mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Integrated foundation code
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -75,9 +75,10 @@ doc/Doxygen/DTAGS
|
||||
# Ignore .tags in the main directory
|
||||
/.tags
|
||||
|
||||
# Ignore eclipse project files in the main directory
|
||||
# Ignore project files in the main directory
|
||||
/.cproject
|
||||
/.project
|
||||
/.dir-locals.el
|
||||
|
||||
# Ignore the test directory
|
||||
/tutorialsTest
|
||||
|
||||
@ -17,10 +17,7 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
wmake -all $targetType solvers
|
||||
wmake -all $targetType utilities
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
(
|
||||
"initialConditions",
|
||||
runTime.constant(),
|
||||
runTime,
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
@ -37,7 +37,7 @@
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
@ -50,7 +50,7 @@
|
||||
(
|
||||
"Rspecific",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
@ -69,7 +69,7 @@
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso BCs
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
(wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1
|
||||
set -x
|
||||
|
||||
wclean libso DPMTurbulenceModels
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType DPMTurbulenceModels
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso twoPhaseMixtureThermo
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType twoPhaseMixtureThermo
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso multiphaseMixtureThermo
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType multiphaseMixtureThermo
|
||||
wmake $targetType
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso mixtureViscosityModels
|
||||
wclean libso relativeVelocityModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType mixtureViscosityModels
|
||||
wmake $targetType relativeVelocityModels
|
||||
|
||||
@ -24,6 +24,9 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "relativeVelocityModel.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "slipFvPatchFields.H"
|
||||
#include "partialSlipFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -33,6 +36,34 @@ namespace Foam
|
||||
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 * * * * * * * * * * * * * * //
|
||||
|
||||
@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel
|
||||
"Udm",
|
||||
alphac_.time().timeName(),
|
||||
alphac_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
alphac_.mesh(),
|
||||
dimensionedVector("Udm", dimVelocity, Zero)
|
||||
dimensionedVector("Udm", dimVelocity, Zero),
|
||||
UdmPatchFieldTypes()
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,12 +52,16 @@ class relativeVelocityModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Return the list of patchFieldTypes for Udm derived from U
|
||||
wordList UdmPatchFieldTypes() const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
relativeVelocityModel(const relativeVelocityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const relativeVelocityModel&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso temperaturePhaseChangeTwoPhaseMixtures
|
||||
wclean
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso phaseChangeTwoPhaseMixtures
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType phaseChangeTwoPhaseMixtures
|
||||
wmake $targetType
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso multiphaseSystem
|
||||
wclean libso interfacialModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmake $targetType multiphaseSystem
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso multiphaseMixture
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType multiphaseMixture
|
||||
wmake $targetType
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso phaseSystems
|
||||
wclean libso interfacialModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmakeLnInclude interfacialCompositionModels
|
||||
|
||||
@ -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>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
|
||||
{
|
||||
const volScalarField& alpha = *this;
|
||||
const volVectorField& U = this->U();
|
||||
const surfaceScalarField& alphaPhi = this->alphaPhi();
|
||||
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi();
|
||||
|
||||
@ -93,7 +121,8 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
|
||||
|
||||
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)
|
||||
|
||||
+ fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_)
|
||||
@ -112,13 +141,15 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
|
||||
// Add the appropriate pressure-work term
|
||||
if (he.name() == this->thermo_->phasePropertyName("e"))
|
||||
{
|
||||
tEEqn.ref() +=
|
||||
fvc::ddt(alpha)*this->thermo().p()
|
||||
+ fvc::div(alphaPhi, this->thermo().p());
|
||||
tEEqn.ref() += filterPressureWork
|
||||
(
|
||||
fvc::div(fvc::absolute(alphaPhi, alpha, U), this->thermo().p())
|
||||
+ this->thermo().p()*fvc::ddt(alpha)
|
||||
);
|
||||
}
|
||||
else if (this->thermo_->dpdt())
|
||||
{
|
||||
tEEqn.ref() -= alpha*this->fluid().dpdt();
|
||||
tEEqn.ref() -= filterPressureWork(alpha*this->fluid().dpdt());
|
||||
}
|
||||
|
||||
return tEEqn;
|
||||
|
||||
@ -58,6 +58,15 @@ class AnisothermalPhaseModel
|
||||
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:
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,12 @@ Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::ReactingPhaseModel
|
||||
BasePhaseModel(fluid, phaseName, index, false),
|
||||
reaction_
|
||||
(
|
||||
ReactionType::New(fluid.mesh(), this->name())
|
||||
ReactionType::New
|
||||
(
|
||||
fluid.mesh(),
|
||||
combustionModel::combustionPropertiesName,
|
||||
this->name()
|
||||
)
|
||||
)
|
||||
{
|
||||
this->thermo_ = &reaction_->thermo();
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso multiphaseSystem
|
||||
wclean libso multiphaseCompressibleTurbulenceModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType multiphaseSystem
|
||||
wmake $targetType multiphaseCompressibleTurbulenceModels
|
||||
|
||||
@ -35,6 +35,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
|
||||
}
|
||||
|
||||
fluid.correctThermo();
|
||||
fluid.correct();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -89,9 +89,6 @@ PtrList<surfaceScalarField> phiFs(phases.size());
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
// Update continuity errors due to temperature changes
|
||||
fluid.correct();
|
||||
|
||||
volScalarField rho("rho", fluid.rho());
|
||||
|
||||
// Correct p_rgh for consistency with p and the updated densities
|
||||
|
||||
@ -77,11 +77,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
//#include "pUf/createDDtU.H"
|
||||
|
||||
int nEnergyCorrectors
|
||||
(
|
||||
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -90,6 +85,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
int nEnergyCorrectors
|
||||
(
|
||||
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso twoPhaseSystem
|
||||
wclean libso twoPhaseCompressibleTurbulenceModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType twoPhaseSystem
|
||||
wmake $targetType twoPhaseCompressibleTurbulenceModels
|
||||
|
||||
@ -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()]
|
||||
+ alpha2*rho2*(U2&g)
|
||||
+ fvOptions(alpha2, rho2, phase2.thermo().he())
|
||||
);
|
||||
|
||||
E2eqn->relax();
|
||||
fvOptions.constrain(E2eqn.ref());
|
||||
E2eqn->solve();
|
||||
E2Eqn->relax();
|
||||
fvOptions.constrain(E2Eqn.ref());
|
||||
E2Eqn->solve();
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -83,9 +83,6 @@ tmp<surfaceScalarField> phiF2;
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
// Update continuity errors due to temperature changes
|
||||
fluid.correct();
|
||||
|
||||
volScalarField rho("rho", fluid.rho());
|
||||
|
||||
// Correct p_rgh for consistency with p and the updated densities
|
||||
|
||||
@ -1,9 +1,2 @@
|
||||
ddtPhi1 =
|
||||
(
|
||||
(phi1 - phi1.oldTime())/runTime.deltaT()
|
||||
);
|
||||
|
||||
ddtPhi2 =
|
||||
(
|
||||
(phi2 - phi2.oldTime())/runTime.deltaT()
|
||||
);
|
||||
ddtPhi1 = fvc::ddt(phi1);
|
||||
ddtPhi2 = fvc::ddt(phi2);
|
||||
|
||||
@ -1,9 +1,2 @@
|
||||
surfaceScalarField ddtPhi1
|
||||
(
|
||||
(phi1 - phi1.oldTime())/runTime.deltaT()
|
||||
);
|
||||
|
||||
surfaceScalarField ddtPhi2
|
||||
(
|
||||
(phi2 - phi2.oldTime())/runTime.deltaT()
|
||||
);
|
||||
surfaceScalarField ddtPhi1(fvc::ddt(phi1));
|
||||
surfaceScalarField ddtPhi2(fvc::ddt(phi2));
|
||||
|
||||
@ -32,10 +32,10 @@ surfaceScalarField rAUf1
|
||||
IOobject::groupName("rAUf", phase1.name()),
|
||||
1.0
|
||||
/(
|
||||
(alphaRhof10 + Vmf)/runTime.deltaT()
|
||||
byDt(alphaRhof10 + Vmf)
|
||||
+ fvc::interpolate(U1Eqn.A())
|
||||
+ Kdf
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField rAUf2
|
||||
@ -43,10 +43,10 @@ surfaceScalarField rAUf2
|
||||
IOobject::groupName("rAUf", phase2.name()),
|
||||
1.0
|
||||
/(
|
||||
(alphaRhof20 + Vmf)/runTime.deltaT()
|
||||
byDt(alphaRhof20 + Vmf)
|
||||
+ fvc::interpolate(U2Eqn.A())
|
||||
+ Kdf
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -93,9 +93,6 @@ tmp<surfaceScalarField> Ff2;
|
||||
|
||||
while (pimple.correct())
|
||||
{
|
||||
// Update continuity errors due to temperature changes
|
||||
fluid.correct();
|
||||
|
||||
volScalarField rho("rho", fluid.rho());
|
||||
|
||||
// Correct p_rgh for consistency with p and the updated densities
|
||||
@ -160,7 +157,7 @@ while (pimple.correct())
|
||||
rAUf1
|
||||
*(
|
||||
(alphaRhof10 + Vmf)
|
||||
*MRF.absolute(phi1.oldTime())/runTime.deltaT()
|
||||
*byDt(MRF.absolute(phi1.oldTime()))
|
||||
+ fvc::flux(U1Eqn.H())
|
||||
+ Vmf*ddtPhi2
|
||||
+ Kdf*MRF.absolute(phi2)
|
||||
@ -178,7 +175,7 @@ while (pimple.correct())
|
||||
rAUf2
|
||||
*(
|
||||
(alphaRhof20 + Vmf)
|
||||
*MRF.absolute(phi2.oldTime())/runTime.deltaT()
|
||||
*byDt(MRF.absolute(phi2.oldTime()))
|
||||
+ fvc::flux(U2Eqn.H())
|
||||
+ Vmf*ddtPhi1
|
||||
+ Kdf*MRF.absolute(phi1)
|
||||
|
||||
@ -43,6 +43,22 @@ Description
|
||||
#include "localEulerDdtScheme.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[])
|
||||
@ -76,13 +92,9 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
|
||||
#include "createRDeltaTf.H"
|
||||
#include "pUf/createDDtU.H"
|
||||
|
||||
int nEnergyCorrectors
|
||||
(
|
||||
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -91,9 +103,18 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
int nEnergyCorrectors
|
||||
(
|
||||
pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
|
||||
);
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
if (faceMomentum)
|
||||
{
|
||||
#include "setRDeltaTf.H"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -0,0 +1 @@
|
||||
trDeltaTf.ref() = fvc::interpolate(fv::localEulerDdt::localRDeltaT(mesh));
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso twoPhaseSystem
|
||||
wclean libso interfacialModels
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmake $targetType twoPhaseSystem
|
||||
|
||||
@ -16,7 +16,8 @@
|
||||
- contErr1*K1
|
||||
+ (
|
||||
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
|
||||
)
|
||||
|
||||
@ -48,7 +49,8 @@
|
||||
- contErr2*K2
|
||||
+ (
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -319,6 +319,9 @@ public:
|
||||
return alphaRhoPhi_;
|
||||
}
|
||||
|
||||
//- Ensure that the flux at inflow BCs is preserved
|
||||
void correctInflowFlux(surfaceScalarField& alphaPhi) const;
|
||||
|
||||
//- Correct the phase properties
|
||||
// other than the thermodynamics and turbulence
|
||||
// which have special treatment
|
||||
|
||||
@ -444,28 +444,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_.correctInflowFlux(alphaPhic1);
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
@ -537,6 +516,7 @@ void Foam::twoPhaseSystem::solve()
|
||||
|
||||
phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
|
||||
alpha2 = scalar(1) - alpha1;
|
||||
phase2_.correctInflowFlux(phase2_.alphaPhi());
|
||||
phase2_.alphaRhoPhi() =
|
||||
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
||||
|
||||
set -x
|
||||
|
||||
# Build libccmio (.a|.so)
|
||||
$WM_THIRD_PARTY_DIR/makeCCMIO lib # libso
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso extrude2DMesh
|
||||
wclean
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType extrude2DMesh
|
||||
wmake $targetType
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
wclean conformalVoronoiMesh
|
||||
wclean conformalVoronoi2DMesh
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
if [ -d "${FASTDUALOCTREE_SRC_PATH}" ]
|
||||
then
|
||||
|
||||
@ -11,7 +11,7 @@ unset COMP_FLAGS LINK_FLAGS
|
||||
#
|
||||
if [ -f /usr/include/readline/readline.h ]
|
||||
then
|
||||
echo "Found <readline/readline.h> -- enabling readline support."
|
||||
echo " found <readline/readline.h> -- enabling readline support."
|
||||
export COMP_FLAGS="-DHAS_READLINE"
|
||||
export LINK_FLAGS="-lreadline"
|
||||
fi
|
||||
|
||||
@ -36,9 +36,6 @@ Description
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "topoSetSource.H"
|
||||
#include "cellSet.H"
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "timeSelector.H"
|
||||
#include "IOobjectList.H"
|
||||
|
||||
@ -342,8 +342,12 @@ FoamFile
|
||||
//
|
||||
// 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
|
||||
// source setToCellZone;
|
||||
// sourceInfo
|
||||
@ -355,6 +359,9 @@ FoamFile
|
||||
//
|
||||
// faceZoneSet
|
||||
// ~~~~~~~~~~~
|
||||
// Manipulates a faceZone (as well as a faceSet). It can only be used
|
||||
// with two special sources:
|
||||
//
|
||||
// // Select based on faceSet without orientation
|
||||
// source setToFaceZone;
|
||||
// sourceInfo
|
||||
@ -394,17 +401,19 @@ FoamFile
|
||||
//
|
||||
// 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
|
||||
// source setToPointZone;
|
||||
// sourceInfo
|
||||
// {
|
||||
// set p0; // name of pointSet
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
actions
|
||||
(
|
||||
@ -465,6 +474,19 @@ actions
|
||||
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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -57,6 +57,9 @@ Usage
|
||||
- \par -includes
|
||||
List the \c #include and \c #includeIfPresent files to standard output
|
||||
|
||||
- \par -disableFunctionEntries
|
||||
Do not expand macros or directives (#include etc)
|
||||
|
||||
Example usage:
|
||||
- Change simulation to run for one timestep only:
|
||||
\verbatim
|
||||
@ -97,6 +100,15 @@ Usage
|
||||
-entry boundaryField
|
||||
\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"
|
||||
@ -271,6 +283,11 @@ int main(int argc, char *argv[])
|
||||
"Read the specified dictionary file, expand the macros etc. and write "
|
||||
"the resulting dictionary to standard output"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"disableFunctionEntries",
|
||||
"Disable expansion of dictionary directives - #include, #codeStream etc"
|
||||
);
|
||||
|
||||
argList args(argc, argv);
|
||||
|
||||
@ -281,6 +298,15 @@ int main(int argc, char *argv[])
|
||||
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]);
|
||||
|
||||
autoPtr<IFstream> dictFile(new IFstream(dictFileName));
|
||||
@ -460,7 +486,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FatalIOErrorInFunction(dictFile)
|
||||
<< "Cannot find entry " << entryName
|
||||
<< exit(FatalError, 2);
|
||||
<< exit(FatalIOError, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType helpTypes
|
||||
wmake $targetType
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType foamToVTK
|
||||
wmake $targetType
|
||||
|
||||
@ -78,9 +78,9 @@ ENDIF()
|
||||
TARGET_LINK_LIBRARIES(
|
||||
PVFoamReader_SM
|
||||
LINK_PUBLIC
|
||||
OpenFOAM
|
||||
finiteVolume
|
||||
vtkPVFoam
|
||||
finiteVolume
|
||||
OpenFOAM
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -106,10 +106,6 @@ public:
|
||||
|
||||
//- Construct from components
|
||||
pqPVFoamReaderPanel(pqProxy*, QWidget*);
|
||||
|
||||
|
||||
//- Destructor
|
||||
// virtual ~pqPVFoamReaderPanel();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -79,9 +79,9 @@ ENDIF()
|
||||
TARGET_LINK_LIBRARIES(
|
||||
PVblockMeshReader_SM
|
||||
LINK_PUBLIC
|
||||
OpenFOAM
|
||||
blockMesh
|
||||
vtkPVblockMesh
|
||||
blockMesh
|
||||
OpenFOAM
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -30,16 +30,17 @@
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
<!-- Update GUI check box -->
|
||||
<!-- Refresh button -->
|
||||
<IntVectorProperty
|
||||
name="UpdateGUI"
|
||||
command="SetUpdateGUI"
|
||||
name="UiRefresh"
|
||||
command="SetRefresh"
|
||||
number_of_elements="1"
|
||||
is_internal="0"
|
||||
default_values="0"
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
A simple way to cause a reader GUI modification.
|
||||
Rescan for updated blockMeshDict.
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
@ -102,6 +103,7 @@
|
||||
|
||||
<Hints>
|
||||
<Property name="FileName" show="0"/>
|
||||
<Property name="UiRefresh" show="0"/>
|
||||
<Property name="UiShowPointNumbers" show="0"/>
|
||||
<ReaderFactory extensions="blockMesh"
|
||||
file_description="OpenFOAM blockMesh"/>
|
||||
|
||||
@ -58,12 +58,30 @@ pqPVblockMeshReaderPanel::pqPVblockMeshReaderPanel
|
||||
:
|
||||
pqAutoGeneratedObjectPanel(proxy, p)
|
||||
{
|
||||
// create first sublayout (at top of the panel)
|
||||
// Create first sublayout (at top of the panel)
|
||||
QGridLayout *form = new QGridLayout();
|
||||
this->PanelLayout->addLayout(form, 0, 0, 1, -1);
|
||||
|
||||
vtkSMProperty* prop = 0;
|
||||
// checkbox for showing point numbers
|
||||
|
||||
// Refresh button for updating blocks
|
||||
if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0)
|
||||
{
|
||||
prop->SetImmediateUpdate(1);
|
||||
QPushButton* refresh = new QPushButton("Refresh");
|
||||
refresh->setToolTip("Rescan for updated blockMeshDict.");
|
||||
|
||||
form->addWidget(refresh, 0, 0, Qt::AlignLeft);
|
||||
QObject::connect
|
||||
(
|
||||
refresh,
|
||||
SIGNAL(clicked()),
|
||||
this,
|
||||
SLOT(RefreshPressed())
|
||||
);
|
||||
}
|
||||
|
||||
// Checkbox for showing point numbers
|
||||
if ((prop = this->proxy()->GetProperty("UiShowPointNumbers")) != 0)
|
||||
{
|
||||
prop->SetImmediateUpdate(true);
|
||||
@ -97,7 +115,7 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled()
|
||||
this->proxy()->GetProperty("UiShowPointNumbers")
|
||||
)->SetElement(0, ShowPointNumbers_->isChecked());
|
||||
|
||||
// update the active view
|
||||
// Update the active view
|
||||
if (this->view())
|
||||
{
|
||||
this->view()->render();
|
||||
@ -107,4 +125,19 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled()
|
||||
}
|
||||
|
||||
|
||||
void pqPVblockMeshReaderPanel::RefreshPressed()
|
||||
{
|
||||
// Update everything
|
||||
vtkSMIntVectorProperty::SafeDownCast
|
||||
(
|
||||
this->proxy()->GetProperty("UiRefresh")
|
||||
)->Modified();
|
||||
|
||||
vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline();
|
||||
|
||||
// Render all views
|
||||
pqApplicationCore::instance()->render();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -67,6 +67,7 @@ class pqPVblockMeshReaderPanel
|
||||
protected slots:
|
||||
|
||||
void ShowPointNumbersToggled();
|
||||
void RefreshPressed();
|
||||
|
||||
|
||||
public:
|
||||
@ -75,10 +76,6 @@ public:
|
||||
|
||||
//- Construct from components
|
||||
pqPVblockMeshReaderPanel(pqProxy*, QWidget*);
|
||||
|
||||
|
||||
//- Destructor
|
||||
// virtual ~pqPVblockMeshReaderPanel();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -60,7 +60,6 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
|
||||
foamData_ = nullptr;
|
||||
|
||||
ShowPointNumbers = 1;
|
||||
UpdateGUI = 0;
|
||||
|
||||
BlockSelection = vtkDataArraySelection::New();
|
||||
CurvedEdgesSelection = vtkDataArraySelection::New();
|
||||
@ -97,7 +96,7 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader()
|
||||
|
||||
if (foamData_)
|
||||
{
|
||||
// remove point numbers
|
||||
// Remove point numbers
|
||||
updatePointNumbersView(false);
|
||||
delete foamData_;
|
||||
}
|
||||
@ -117,7 +116,6 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader()
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
// Do everything except set the output info
|
||||
int vtkPVblockMeshReader::RequestInformation
|
||||
(
|
||||
vtkInformation* vtkNotUsed(request),
|
||||
@ -158,23 +156,10 @@ int vtkPVblockMeshReader::RequestInformation
|
||||
foamData_->updateInfo();
|
||||
}
|
||||
|
||||
// might need some other type of error handling
|
||||
|
||||
// {
|
||||
// vtkErrorMacro("could not find valid OpenFOAM blockMesh");
|
||||
//
|
||||
// // delete foamData and flag it as fatal error
|
||||
// delete foamData_;
|
||||
// foamData_ = nullptr;
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Set the output info
|
||||
int vtkPVblockMeshReader::RequestData
|
||||
(
|
||||
vtkInformation* vtkNotUsed(request),
|
||||
@ -190,7 +175,7 @@ int vtkPVblockMeshReader::RequestData
|
||||
return 0;
|
||||
}
|
||||
|
||||
// catch previous error
|
||||
// Catch previous error
|
||||
if (!foamData_)
|
||||
{
|
||||
vtkErrorMacro("Reader failed - perhaps no mesh?");
|
||||
@ -233,6 +218,19 @@ int vtkPVblockMeshReader::RequestData
|
||||
}
|
||||
|
||||
|
||||
void vtkPVblockMeshReader::SetRefresh(int val)
|
||||
{
|
||||
// Delete the current blockMesh to force re-read and update
|
||||
if (foamData_)
|
||||
{
|
||||
updatePointNumbersView(false);
|
||||
delete foamData_;
|
||||
foamData_ = 0;
|
||||
}
|
||||
|
||||
Modified();
|
||||
}
|
||||
|
||||
|
||||
void vtkPVblockMeshReader::SetShowPointNumbers(const int val)
|
||||
{
|
||||
@ -248,7 +246,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show)
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
|
||||
// need to check this, since our destructor calls this
|
||||
// Need to check this, since our destructor calls this
|
||||
if (!appCore)
|
||||
{
|
||||
return;
|
||||
@ -273,7 +271,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show)
|
||||
);
|
||||
}
|
||||
|
||||
// use refresh here?
|
||||
// Use refresh here?
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -77,10 +77,8 @@ public:
|
||||
vtkGetMacro(ShowPointNumbers, int);
|
||||
|
||||
// Description:
|
||||
// GUI update control
|
||||
vtkSetMacro(UpdateGUI, int);
|
||||
vtkGetMacro(UpdateGUI, int);
|
||||
|
||||
// Refresh blockMesh from changes to blockMeshDict
|
||||
virtual void SetRefresh(int);
|
||||
|
||||
// Description:
|
||||
// Blocks selection list control
|
||||
@ -158,9 +156,6 @@ private:
|
||||
//- Show Point Numbers
|
||||
int ShowPointNumbers;
|
||||
|
||||
//- Dummy variable/switch to invoke a reader update
|
||||
int UpdateGUI;
|
||||
|
||||
vtkDataArraySelection* BlockSelection;
|
||||
|
||||
vtkDataArraySelection* CurvedEdgesSelection;
|
||||
|
||||
@ -72,12 +72,17 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
||||
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
|
||||
const int nBlocks = blkMesh.size();
|
||||
for (int blockI = 0; blockI < nBlocks; ++blockI)
|
||||
{
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
word partName = Foam::name(blockI);
|
||||
// Display either blockI as a number or with its name
|
||||
// (looked up from blockMeshDict)
|
||||
OStringStream os;
|
||||
blockDescriptor::write(os, blockI, blkMesh.meshDict());
|
||||
word partName(os.str());
|
||||
|
||||
// append the (optional) zone name
|
||||
if (!blockDef.zoneName().empty())
|
||||
@ -121,9 +126,10 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
||||
forAll(edges, edgeI)
|
||||
{
|
||||
OStringStream ostr;
|
||||
|
||||
ostr<< edges[edgeI].start() << ":" << edges[edgeI].end() << " - "
|
||||
<< edges[edgeI].type();
|
||||
blockVertex::write(ostr, edges[edgeI].start(), blkMesh.meshDict());
|
||||
ostr<< ":";
|
||||
blockVertex::write(ostr, edges[edgeI].end(), blkMesh.meshDict());
|
||||
ostr << " - " << edges[edgeI].type();
|
||||
|
||||
// Add "beg:end - type" to GUI list
|
||||
arraySelection->AddArray(ostr.str().c_str());
|
||||
@ -352,7 +358,9 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
||||
dictPath = dbPtr_().constant()/polyMesh::meshSubDir/dictName;
|
||||
}
|
||||
|
||||
IOdictionary meshDict
|
||||
// Store dictionary since is used as database inside blockMesh class
|
||||
// for names of vertices and blocks
|
||||
IOdictionary* meshDictPtr = new IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -360,11 +368,12 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
||||
dbPtr_(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
true
|
||||
)
|
||||
);
|
||||
meshDictPtr->store();
|
||||
|
||||
meshPtr_ = new blockMesh(meshDict, meshRegion_);
|
||||
meshPtr_ = new blockMesh(*meshDictPtr, meshRegion_);
|
||||
}
|
||||
|
||||
|
||||
@ -429,15 +438,22 @@ void Foam::vtkPVblockMesh::renderPointNumbers
|
||||
|
||||
if (show && meshPtr_)
|
||||
{
|
||||
const pointField& cornerPts = meshPtr_->vertices();
|
||||
const scalar scaleFactor = meshPtr_->scaleFactor();
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const pointField& cornerPts = blkMesh.vertices();
|
||||
const scalar scaleFactor = blkMesh.scaleFactor();
|
||||
|
||||
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
|
||||
forAll(cornerPts, pointi)
|
||||
{
|
||||
vtkTextActor* txt = vtkTextActor::New();
|
||||
|
||||
txt->SetInput(Foam::name(pointi).c_str());
|
||||
// Display either pointi as a number or with its name
|
||||
// (looked up from blockMeshDict)
|
||||
{
|
||||
OStringStream os;
|
||||
blockVertex::write(os, pointi, blkMesh.meshDict());
|
||||
txt->SetInput(os.str().c_str());
|
||||
}
|
||||
|
||||
// Set text properties
|
||||
vtkTextProperty* tprop = txt->GetTextProperty();
|
||||
|
||||
@ -384,24 +384,18 @@ public:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addDictOption.H"
|
||||
#include "addRegionOption.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createNamedMesh.H"
|
||||
|
||||
Info<< "Reading setFieldsDict\n" << endl;
|
||||
const word dictName("setFieldsDict");
|
||||
#include "setSystemMeshDictionaryIO.H"
|
||||
|
||||
IOdictionary setFieldsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"setFieldsDict",
|
||||
runTime.system(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
Info<< "Reading " << dictName << "\n" << endl;
|
||||
|
||||
IOdictionary setFieldsDict(dictIO);
|
||||
|
||||
if (setFieldsDict.found("defaultFieldValues"))
|
||||
{
|
||||
|
||||
@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
wmake $targetType tabulatedWallFunction
|
||||
wmake $targetType
|
||||
|
||||
26
bin/foamTags
26
bin/foamTags
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -46,8 +46,7 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
for cmd in etags ectags
|
||||
for cmd in etags ctags-exuberant
|
||||
do
|
||||
type $cmd >/dev/null 2>&1 || {
|
||||
echo "${0##*/} cannot build tag files: '$cmd' command not found"
|
||||
@ -55,29 +54,16 @@ do
|
||||
}
|
||||
done
|
||||
|
||||
|
||||
cd $WM_PROJECT_DIR || exit 1
|
||||
mkdir .tags 2>/dev/null
|
||||
|
||||
|
||||
etagsCmd="etags --declarations -l c++ -o .tags/etags -"
|
||||
#etagsDefCmd="etags -l c++ -o .tags/etagsDef -"
|
||||
#etagsDecCmd="etags --declarations -l c++ -o .tags/etagsDec -"
|
||||
|
||||
etagsCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
|
||||
etagsDefCmd="ectags -e --extra=+fq --file-scope=no -o .tags/etagsDef -L -"
|
||||
etagsDecCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etagsDec -L -"
|
||||
|
||||
ectagsDecCmd="ectags -o .tags/ectagsDec --file-scope=no --c-kinds=+p --excmd=n --extra=+fq --fields=+afiKmnsSzt -L -"
|
||||
#etagsCmd="etags --declarations -l c++ -o .tags/etags -"
|
||||
etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
|
||||
|
||||
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd
|
||||
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDefCmd
|
||||
find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDecCmd
|
||||
find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $ectagsDecCmd
|
||||
|
||||
gtags -i --gtagsconf bin/tools/gtagsrc .tags
|
||||
|
||||
foamEbrowse
|
||||
#gtags -i --gtagsconf bin/tools/gtagsrc .tags
|
||||
|
||||
#foamEbrowse
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#-------------------------------*- makefile -*---------------------------------
|
||||
#----------------------------*- makefile-gmake -*------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
|
||||
@ -36,8 +36,9 @@ contCumulative/time step continuity errors :/cumulative =
|
||||
minFu/min\(fu\) = /min(fu) =
|
||||
minFt/min\(ft\) = /min(ft) =
|
||||
|
||||
#- Execution time:
|
||||
#- Timing:
|
||||
executionTime/ExecutionTime = /ExecutionTime =
|
||||
clockTime/ClockTime = /ClockTime =
|
||||
|
||||
#- Interface Courant no:
|
||||
IntCourantMax/Interface Courant Number /max:
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
set -x
|
||||
|
||||
# fix permissions (NB: '+X' and not '+x'!)
|
||||
chmod a+rX $WM_PROJECT_DIR $WM_PROJECT_DIR/doc Doxygen
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
[ -d "$WM_PROJECT_DIR" ] || {
|
||||
echo "Error: WM_PROJECT_DIR directory does not exist"
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
|
||||
echo " Error: WM_PROJECT_DIR directory does not exist"
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -58,7 +58,6 @@ do
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
set -x
|
||||
|
||||
rm -rf latex man
|
||||
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# Script
|
||||
# find-its
|
||||
#
|
||||
# Description
|
||||
# Search for files with "it's"
|
||||
# This contraction (== "it is") looks too much like "its" (possesive)
|
||||
# and confuses non-native (and some native) English speakers.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
set -x
|
||||
cd $WM_PROJECT_DIR || exit 1
|
||||
|
||||
git grep -e "it's"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -7,7 +7,6 @@
|
||||
# Search for files with trailing whitesapce
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
set -x
|
||||
cd $WM_PROJECT_DIR || exit 1
|
||||
|
||||
tab=$'\t'
|
||||
|
||||
@ -61,7 +61,7 @@ export FOAM_INST_DIR
|
||||
export WM_COMPILER_TYPE=system
|
||||
|
||||
#- Compiler:
|
||||
# WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc
|
||||
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
|
||||
export WM_COMPILER=Gcc
|
||||
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
|
||||
|
||||
@ -85,7 +85,7 @@ export WM_COMPILE_OPTION=Opt
|
||||
|
||||
#- MPI implementation:
|
||||
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
|
||||
# | MPI | QSMPI | SGIMPI
|
||||
# | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI
|
||||
export WM_MPLIB=SYSTEMOPENMPI
|
||||
|
||||
#- Operating System:
|
||||
|
||||
21
etc/caseDicts/postProcessing/fields/add
Normal file
21
etc/caseDicts/postProcessing/fields/add
Normal file
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Add a list of fields.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type add;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
fields (<field names>);
|
||||
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
|
||||
// ************************************************************************* //
|
||||
21
etc/caseDicts/postProcessing/fields/subtract
Normal file
21
etc/caseDicts/postProcessing/fields/subtract
Normal file
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
From the first field subtract the remaining fields in the list.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type subtract;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
fields (<field names>);
|
||||
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -58,6 +58,8 @@ set cmake_version=cmake-system
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
||||
|
||||
# Clean the PATH
|
||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
||||
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
||||
|
||||
@ -41,9 +41,6 @@ ThirdParty)
|
||||
Gcc | Gcc48)
|
||||
gcc_version=gcc-4.8.5
|
||||
;;
|
||||
Gcc47)
|
||||
gcc_version=gcc-4.7.4
|
||||
;;
|
||||
Gcc49)
|
||||
gcc_version=gcc-4.9.3
|
||||
;;
|
||||
|
||||
@ -888,7 +888,6 @@ DebugSwitches
|
||||
wallHeatTransfer 0;
|
||||
wallLayerCells 0;
|
||||
wallModel 0;
|
||||
warnUnboundedGauss 1;
|
||||
waveTransmissive 0;
|
||||
wedge 0;
|
||||
weighted 0;
|
||||
|
||||
@ -61,7 +61,7 @@ echo $FOAM_INST_DIR
|
||||
setenv WM_COMPILER_TYPE system
|
||||
|
||||
#- Compiler:
|
||||
# WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc
|
||||
# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
|
||||
setenv WM_COMPILER Gcc
|
||||
setenv WM_COMPILER_ARCH # defined but empty
|
||||
unsetenv WM_COMPILER_LIB_ARCH
|
||||
@ -86,7 +86,7 @@ setenv WM_COMPILE_OPTION Opt
|
||||
|
||||
#- MPI implementation:
|
||||
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
|
||||
# | MPI | QSMPI | SGIMPI
|
||||
# | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI
|
||||
setenv WM_MPLIB SYSTEMOPENMPI
|
||||
|
||||
#- Operating System:
|
||||
|
||||
@ -17,8 +17,6 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
# Update OpenFOAM version strings if required
|
||||
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::ODESolver::normalizeError
|
||||
(
|
||||
|
||||
@ -12,7 +12,7 @@ unset COMP_FLAGS LINK_FLAGS
|
||||
#
|
||||
if [ -f /usr/include/sys/inotify.h ]
|
||||
then
|
||||
echo "Found <sys/inotify.h> -- enabling inotify for file monitoring."
|
||||
echo " found <sys/inotify.h> -- enabling inotify for file monitoring."
|
||||
export COMP_FLAGS="-DFOAM_USE_INOTIFY"
|
||||
else
|
||||
unset COMP_FLAGS
|
||||
|
||||
@ -542,6 +542,22 @@ time_t Foam::lastModified(const fileName& name, const bool followLink)
|
||||
}
|
||||
|
||||
|
||||
double Foam::highResLastModified(const fileName& name)
|
||||
{
|
||||
fileStat fileStatus(name);
|
||||
if (fileStatus.isValid())
|
||||
{
|
||||
return
|
||||
fileStatus.status().st_mtime
|
||||
+ 1e-9*fileStatus.status().st_atim.tv_nsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::fileNameList Foam::readDir
|
||||
(
|
||||
const fileName& directory,
|
||||
|
||||
@ -126,7 +126,7 @@ namespace Foam
|
||||
// For stat
|
||||
|
||||
//- From watch descriptor to modified time
|
||||
DynamicList<time_t> lastMod_;
|
||||
DynamicList<double> lastMod_;
|
||||
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ namespace Foam
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
lastMod_(watchFd) = lastModified(fName);
|
||||
lastMod_(watchFd) = highResLastModified(fName);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -395,12 +395,12 @@ void Foam::fileMonitor::checkFiles() const
|
||||
{
|
||||
forAll(watcher_->lastMod_, watchFd)
|
||||
{
|
||||
time_t oldTime = watcher_->lastMod_[watchFd];
|
||||
double oldTime = watcher_->lastMod_[watchFd];
|
||||
|
||||
if (oldTime != 0)
|
||||
{
|
||||
const fileName& fName = watchFile_[watchFd];
|
||||
time_t newTime = lastModified(fName);
|
||||
double newTime = highResLastModified(fName);
|
||||
|
||||
if (newTime == 0)
|
||||
{
|
||||
@ -615,7 +615,7 @@ void Foam::fileMonitor::setUnmodified(const label watchFd)
|
||||
|
||||
if (!useInotify_)
|
||||
{
|
||||
watcher_->lastMod_[watchFd] = lastModified(watchFile_[watchFd]);
|
||||
watcher_->lastMod_[watchFd] = highResLastModified(watchFile_[watchFd]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ $(ints)/lists/labelListIOList.C
|
||||
primitives/Scalar/doubleScalar/doubleScalar.C
|
||||
primitives/Scalar/floatScalar/floatScalar.C
|
||||
primitives/Scalar/scalar/scalar.C
|
||||
primitives/Scalar/scalar/invIncGamma.C
|
||||
primitives/Scalar/lists/scalarList.C
|
||||
primitives/Scalar/lists/scalarIOList.C
|
||||
primitives/Scalar/lists/scalarListIOList.C
|
||||
@ -187,6 +188,10 @@ dictionaryEntry = $(dictionary)/dictionaryEntry
|
||||
$(dictionaryEntry)/dictionaryEntry.C
|
||||
$(dictionaryEntry)/dictionaryEntryIO.C
|
||||
|
||||
dictionaryListEntry = $(dictionary)/dictionaryListEntry
|
||||
$(dictionaryListEntry)/dictionaryListEntry.C
|
||||
$(dictionaryListEntry)/dictionaryListEntryIO.C
|
||||
|
||||
functionEntries = $(dictionary)/functionEntries
|
||||
$(functionEntries)/calcEntry/calcEntry.C
|
||||
$(functionEntries)/codeStream/codeStream.C
|
||||
|
||||
@ -119,7 +119,7 @@ private:
|
||||
|
||||
// Static data
|
||||
|
||||
//- Relative peturbation tolerance. Determines when point is
|
||||
//- Relative perturbation tolerance. Determines when point is
|
||||
// considered to be close to face/edge of bb of node.
|
||||
// The tolerance is relative to the bounding box of the smallest
|
||||
// node.
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "DictionaryBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class IDLListType, class T>
|
||||
void Foam::DictionaryBase<IDLListType, T>::addEntries()
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,6 +62,4 @@ Foam::Ostream& Foam::operator<<
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -238,6 +238,7 @@ private:
|
||||
const label index
|
||||
);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
@ -80,7 +80,7 @@ const int Foam::Time::maxPrecision_(3 - log10(SMALL));
|
||||
Foam::word Foam::Time::controlDictName("controlDict");
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::Time::adjustDeltaT()
|
||||
{
|
||||
|
||||
@ -59,6 +59,7 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class argList;
|
||||
|
||||
@ -86,6 +87,7 @@ class Time
|
||||
//- The controlDict
|
||||
unwatchedIOdictionary controlDict_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Write control options
|
||||
|
||||
@ -46,6 +46,131 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
const Foam::entry* Foam::dictionary::lookupScopedSubEntryPtr
|
||||
(
|
||||
const word& keyword,
|
||||
bool recursive,
|
||||
bool patternMatch
|
||||
) const
|
||||
{
|
||||
string::size_type dotPos = keyword.find('.');
|
||||
|
||||
if (dotPos == string::npos)
|
||||
{
|
||||
// Non-scoped lookup
|
||||
return lookupEntryPtr(keyword, recursive, patternMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dotPos == 0)
|
||||
{
|
||||
// Starting with a '.'. Go up for every 2nd '.' found
|
||||
|
||||
const dictionary* dictPtr = this;
|
||||
|
||||
string::size_type begVar = dotPos + 1;
|
||||
string::const_iterator iter = keyword.begin() + begVar;
|
||||
string::size_type endVar = begVar;
|
||||
while (iter != keyword.end() && *iter == '.')
|
||||
{
|
||||
++iter;
|
||||
++endVar;
|
||||
|
||||
// Go to parent
|
||||
if (&dictPtr->parent_ == &dictionary::null)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
*this
|
||||
) << "No parent of current dictionary"
|
||||
<< " when searching for "
|
||||
<< keyword.substr(begVar, keyword.size()-begVar)
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
dictPtr = &dictPtr->parent_;
|
||||
}
|
||||
|
||||
return dictPtr->lookupScopedSubEntryPtr
|
||||
(
|
||||
keyword.substr(endVar),
|
||||
false,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extract the first word
|
||||
word firstWord = keyword.substr(0, dotPos);
|
||||
|
||||
const entry* entPtr = lookupScopedSubEntryPtr
|
||||
(
|
||||
firstWord,
|
||||
false, //recursive
|
||||
patternMatch
|
||||
);
|
||||
|
||||
if (!entPtr)
|
||||
{
|
||||
// Fall back to finding key with '.' so e.g. if keyword is
|
||||
// a.b.c.d it would try
|
||||
// a.b, a.b.c, a.b.c.d
|
||||
|
||||
string::size_type nextDotPos = keyword.find
|
||||
(
|
||||
'.',
|
||||
dotPos+1
|
||||
);
|
||||
|
||||
while (true)
|
||||
{
|
||||
const entry* subEntPtr = lookupEntryPtr
|
||||
(
|
||||
keyword.substr(0, nextDotPos),
|
||||
false, //recursive,
|
||||
patternMatch
|
||||
);
|
||||
if (nextDotPos == string::npos)
|
||||
{
|
||||
// Parsed the whole word. Return entry or null.
|
||||
return subEntPtr;
|
||||
}
|
||||
|
||||
if (subEntPtr && subEntPtr->isDict())
|
||||
{
|
||||
return subEntPtr->dict().lookupScopedSubEntryPtr
|
||||
(
|
||||
keyword.substr
|
||||
(
|
||||
nextDotPos,
|
||||
keyword.size()-nextDotPos
|
||||
),
|
||||
false,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
|
||||
nextDotPos = keyword.find('.', nextDotPos+1);
|
||||
}
|
||||
}
|
||||
|
||||
if (entPtr->isDict())
|
||||
{
|
||||
return entPtr->dict().lookupScopedSubEntryPtr
|
||||
(
|
||||
keyword.substr(dotPos, keyword.size()-dotPos),
|
||||
false,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::dictionary::findInPatterns
|
||||
(
|
||||
const bool patternMatch,
|
||||
@ -473,7 +598,7 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr
|
||||
}
|
||||
|
||||
// At top. Recurse to find entries
|
||||
return dictPtr->lookupScopedEntryPtr
|
||||
return dictPtr->lookupScopedSubEntryPtr
|
||||
(
|
||||
keyword.substr(1, keyword.size()-1),
|
||||
false,
|
||||
@ -482,93 +607,12 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr
|
||||
}
|
||||
else
|
||||
{
|
||||
string::size_type dotPos = keyword.find('.');
|
||||
|
||||
if (dotPos == string::npos)
|
||||
{
|
||||
// Non-scoped lookup
|
||||
return lookupEntryPtr(keyword, recursive, patternMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dotPos == 0)
|
||||
{
|
||||
// Starting with a '.'. Go up for every 2nd '.' found
|
||||
|
||||
const dictionary* dictPtr = this;
|
||||
|
||||
string::size_type begVar = dotPos + 1;
|
||||
string::const_iterator iter = keyword.begin() + begVar;
|
||||
string::size_type endVar = begVar;
|
||||
while
|
||||
(
|
||||
iter != keyword.end()
|
||||
&& *iter == '.'
|
||||
)
|
||||
{
|
||||
++iter;
|
||||
++endVar;
|
||||
|
||||
// Go to parent
|
||||
if (&dictPtr->parent_ == &dictionary::null)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
*this
|
||||
) << "No parent of current dictionary"
|
||||
<< " when searching for "
|
||||
<< keyword.substr(begVar, keyword.size()-begVar)
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
dictPtr = &dictPtr->parent_;
|
||||
}
|
||||
|
||||
return dictPtr->lookupScopedEntryPtr
|
||||
(
|
||||
keyword.substr(endVar),
|
||||
false,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extract the first word
|
||||
word firstWord = keyword.substr(0, dotPos);
|
||||
|
||||
const entry* entPtr = lookupScopedEntryPtr
|
||||
(
|
||||
firstWord,
|
||||
false, //recursive
|
||||
patternMatch
|
||||
);
|
||||
|
||||
if (!entPtr)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
*this
|
||||
) << "keyword " << firstWord
|
||||
<< " is undefined in dictionary "
|
||||
<< name() << endl
|
||||
<< "Valid keywords are " << keys()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (entPtr->isDict())
|
||||
{
|
||||
return entPtr->dict().lookupScopedEntryPtr
|
||||
(
|
||||
keyword.substr(dotPos, keyword.size()-dotPos),
|
||||
false,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lookupScopedSubEntryPtr
|
||||
(
|
||||
keyword,
|
||||
recursive,
|
||||
patternMatch
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,6 +672,21 @@ const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const
|
||||
}
|
||||
|
||||
|
||||
Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword)
|
||||
{
|
||||
entry* entryPtr = lookupEntryPtr(keyword, false, true);
|
||||
|
||||
if (entryPtr)
|
||||
{
|
||||
return &entryPtr->dict();
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
|
||||
{
|
||||
const entry* entryPtr = lookupEntryPtr(keyword, false, true);
|
||||
|
||||
@ -161,6 +161,15 @@ class dictionary
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Find and return an entry data stream pointer if present
|
||||
// otherwise return nullptr. Allows scoping using '.'
|
||||
const entry* lookupScopedSubEntryPtr
|
||||
(
|
||||
const word&,
|
||||
bool recursive,
|
||||
bool patternMatch
|
||||
) const;
|
||||
|
||||
//- Search patterns table for exact match or regular expression match
|
||||
bool findInPatterns
|
||||
(
|
||||
@ -364,7 +373,8 @@ public:
|
||||
) const;
|
||||
|
||||
//- Find and return an entry data stream pointer if present
|
||||
// otherwise return nullptr. Allows scoping using '.'
|
||||
// otherwise return nullptr. Allows scoping using '.'.
|
||||
// Special handling for ':' at start of keyword and '..'.
|
||||
const entry* lookupScopedEntryPtr
|
||||
(
|
||||
const word&,
|
||||
@ -379,6 +389,10 @@ public:
|
||||
// otherwise return nullptr.
|
||||
const dictionary* subDictPtr(const word&) const;
|
||||
|
||||
//- Find and return a sub-dictionary pointer if present
|
||||
// otherwise return nullptr.
|
||||
dictionary* subDictPtr(const word&);
|
||||
|
||||
//- Find and return a sub-dictionary
|
||||
const dictionary& subDict(const word&) const;
|
||||
|
||||
|
||||
@ -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) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,44 +23,18 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "block.H"
|
||||
#include "dictionaryListEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::block::block
|
||||
Foam::dictionaryListEntry::dictionaryListEntry
|
||||
(
|
||||
const pointField& vertices,
|
||||
const blockEdgeList& edges,
|
||||
const blockFaceList& faces,
|
||||
Istream& is
|
||||
const dictionary& parentDict,
|
||||
const dictionaryListEntry& dictEnt
|
||||
)
|
||||
:
|
||||
blockDescriptor(vertices, edges, faces, is)
|
||||
{
|
||||
createPoints();
|
||||
createBoundary();
|
||||
}
|
||||
|
||||
|
||||
Foam::block::block(const blockDescriptor& blockDesc)
|
||||
:
|
||||
blockDescriptor(blockDesc)
|
||||
{
|
||||
createPoints();
|
||||
createBoundary();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const block& b)
|
||||
{
|
||||
os << b.points() << nl
|
||||
<< b.cells() << nl
|
||||
<< b.boundaryPatches() << endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
dictionaryEntry(parentDict, dictEnt)
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user