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

This commit is contained in:
mattijs
2010-05-10 14:31:52 +01:00
342 changed files with 7473 additions and 3660 deletions

View File

@ -134,7 +134,7 @@ if (ign.ignited())
(sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt) (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt)
/(sqr(Su0 - SuInf) + sqr(SuMin)); /(sqr(Su0 - SuInf) + sqr(SuMin));
solve fvScalarMatrix SuEqn
( (
fvm::ddt(rho, Su) fvm::ddt(rho, Su)
+ fvm::div(phi + phiXi, Su, "div(phiXi,Su)") + fvm::div(phi + phiXi, Su, "div(phiXi,Su)")
@ -144,6 +144,9 @@ if (ign.ignited())
- fvm::SuSp(rho*(sigmas + Rc), Su) - fvm::SuSp(rho*(sigmas + Rc), Su)
); );
SuEqn.relax();
SuEqn.solve();
// Limit the maximum Su // Limit the maximum Su
// ~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~
Su.min(SuMax); Su.min(SuMax);
@ -196,7 +199,7 @@ if (ign.ignited())
// Solve for the flame wrinkling // Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solve fvScalarMatrix XiEqn
( (
fvm::ddt(rho, Xi) fvm::ddt(rho, Xi)
+ fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)") + fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)")
@ -215,6 +218,8 @@ if (ign.ignited())
) )
); );
XiEqn.relax();
XiEqn.solve();
// Correct boundedness of Xi // Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1; label inertIndex = -1;
volScalarField Yt = 0.0*Y[0]; volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++) forAll(Y, i)
{ {
if (Y[i].name() != inertSpecie) if (Y[i].name() != inertSpecie)
{ {

View File

@ -43,7 +43,7 @@ volScalarField Sevap
dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0) dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0)
); );
for (label i=0; i<Y.size(); i++) forAll(Y, i)
{ {
if (dieselSpray.isLiquidFuel()[i]) if (dieselSpray.isLiquidFuel()[i])
{ {

View File

@ -13,7 +13,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1; label inertIndex = -1;
volScalarField Yt = 0.0*Y[0]; volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++) forAll(Y, i)
{ {
if (Y[i].name() != inertSpecie) if (Y[i].name() != inertSpecie)
{ {

View File

@ -13,7 +13,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1; label inertIndex = -1;
volScalarField Yt = 0.0*Y[0]; volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++) forAll(Y, i)
{ {
if (Y[i].name() != inertSpecie) if (Y[i].name() != inertSpecie)
{ {

View File

@ -63,8 +63,7 @@
<< exit(FatalIOError); << exit(FatalIOError);
} }
const labelList& faces = const labelList& faces = mesh.faceZones()[magnetZonei];
mesh.faceZones()[magnetZonei];
const scalar muri = magnets[i].mur(); const scalar muri = magnets[i].mur();
const scalar Mri = magnets[i].Mr().value(); const scalar Mri = magnets[i].Mr().value();

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean
wclean chtMultiRegionSimpleFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake chtMultiRegionSimpleFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,4 @@
chtMultiRegionSimpleFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam

View File

@ -1,5 +1,7 @@
EXE_INC = \ EXE_INC = \
/* -DFULLDEBUG -O0 -g */ \ /* -DFULLDEBUG -O0 -g */ \
-I.. \
-I../derivedFvPatchFields \
-Ifluid \ -Ifluid \
-Isolid \ -Isolid \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \

View File

@ -1,5 +0,0 @@
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
chtMultiRegionSimpleFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam

View File

@ -1,168 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "solidWallHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
q_(p.size(), 0.0),
KName_("undefined-K")
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
q_(ptf.q_, mapper),
KName_(ptf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF, dict),
q_("q", dict, p.size()),
KName_(dict.lookup("K"))
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
)
:
fixedGradientFvPatchScalarField(tppsf),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(tppsf, iF),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedGradientFvPatchScalarField::autoMap(m);
q_.autoMap(m);
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchScalarField::rmap(ptf, addr);
const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
q_.rmap(hfptf.q_, addr);
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const scalarField& Kw = patch().lookupPatchField<volScalarField, scalar>
(
KName_
);
gradient() = q_/Kw;
fixedGradientFvPatchScalarField::updateCoeffs();
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
(
Ostream& os
) const
{
fixedGradientFvPatchScalarField::write(os);
q_.writeEntry("q", os);
os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
solidWallHeatFluxTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -1,180 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
solidWallHeatFluxTemperatureFvPatchScalarField
Description
Heat flux boundary condition for temperature on solid region
Example usage:
myWallPatch
{
type solidWallHeatFluxTemperature;
K K; // Name of K field
q uniform 1000; // Heat flux / [W/m2]
value 300.0; // Initial temperature / [K]
}
SourceFiles
solidWallHeatFluxTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
#define solidWallHeatFluxTemperatureFvPatchScalarField_H
#include "fixedGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class solidWallHeatFluxTemperatureFvPatchScalarField
:
public fixedGradientFvPatchScalarField
{
// Private data
//- Heat flux / [W/m2]
scalarField q_;
//- Name of thermal conductivity field
word KName_;
public:
//- Runtime type information
TypeName("solidWallHeatFluxTemperature");
// Constructors
//- Construct from patch and internal field
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// solidWallHeatFluxTemperatureFvPatchScalarField
// onto a new patch
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new solidWallHeatFluxTemperatureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -84,10 +84,8 @@
dimensionedScalar lambda(laminarTransport.lookup("lambda")); dimensionedScalar lambda(laminarTransport.lookup("lambda"));
dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax")); dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax"));
const labelList& inletCells = const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
mesh.boundary()[mesh.boundaryMesh().findPatchID("inlet")].faceCells(); //const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
//const labelList& outletCells =
// mesh.boundary()[mesh.boundaryMesh().findPatchID("outlet")].faceCells();
volScalarField alpha volScalarField alpha
( (

View File

@ -27,7 +27,7 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
for (label i=0; i<p.boundaryField().size(); i++) forAll(p.boundaryField(), i)
{ {
if (p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {

View File

@ -150,9 +150,9 @@ int main(int argc, char *argv[])
U -= rAU*fvc::grad(p); U -= rAU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
}
turbulence->correct(); turbulence->correct();
}
runTime.write(); runTime.write();

View File

@ -41,7 +41,12 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addOption("cloudName", "cloud name"); argList::addOption
(
"cloudName",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"

View File

@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1; label inertIndex = -1;
volScalarField Yt = 0.0*Y[0]; volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++) forAll(Y, i)
{ {
if (Y[i].name() != inertSpecie) if (Y[i].name() != inertSpecie)
{ {

View File

@ -41,7 +41,12 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addOption("cloudName", "cloud name"); argList::addOption
(
"cloudName",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"

View File

@ -36,7 +36,7 @@
calculatedFvPatchScalarField::typeName calculatedFvPatchScalarField::typeName
); );
for (label i=0; i<Ua.boundaryField().size(); i++) forAll(Ua.boundaryField(), i)
{ {
if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i])) if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
{ {

View File

@ -36,7 +36,7 @@
calculatedFvPatchScalarField::typeName calculatedFvPatchScalarField::typeName
); );
for (label i=0; i<Ub.boundaryField().size(); i++) forAll(Ub.boundaryField(), i)
{ {
if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i])) if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
{ {

View File

@ -135,7 +135,7 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
for (label i=0; i<p.boundaryField().size(); i++) forAll(p.boundaryField(), i)
{ {
if (p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {

View File

@ -98,7 +98,7 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
for (label i=0; i<p.boundaryField().size(); i++) forAll(p.boundaryField(), i)
{ {
if (p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {

View File

@ -7,7 +7,7 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
for (label i=0; i<p.boundaryField().size(); i++) forAll(p.boundaryField(), i)
{ {
if (p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {

View File

@ -7,7 +7,7 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
for (label i=0; i<p.boundaryField().size(); i++) forAll(p.boundaryField(), i)
{ {
if (p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {

View File

@ -106,7 +106,7 @@ Foam::phaseModel::phaseModel
calculatedFvPatchScalarField::typeName calculatedFvPatchScalarField::typeName
); );
for (label i=0; i<U_.boundaryField().size(); i++) forAll(U_.boundaryField(), i)
{ {
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i])) if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
{ {

View File

@ -43,7 +43,6 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::validArgs.clear();
argList args(argc, argv); argList args(argc, argv);
FixedList<label, 4> list; FixedList<label, 4> list;

View File

@ -104,7 +104,6 @@ public:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::validArgs.clear();
argList::validArgs.append("ODESolver"); argList::validArgs.append("ODESolver");
argList args(argc, argv); argList args(argc, argv);

View File

@ -45,7 +45,6 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::validArgs.clear();
argList args(argc, argv); argList args(argc, argv);
//Pout.prefix() = '[' + name(Pstream::myProcNo()) + "] "; //Pout.prefix() = '[' + name(Pstream::myProcNo()) + "] ";

View File

@ -220,10 +220,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word patchName = args[1]; const word patchName = args[1];
const polyPatch& patch = mesh.boundaryMesh()[patchName];
label patchI = mesh.boundaryMesh().findPatchID(patchName);
const polyPatch& patch = mesh.boundaryMesh()[patchI];
Info<< "Patch:" << patch.name() << endl; Info<< "Patch:" << patch.name() << endl;

View File

@ -35,7 +35,6 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::validArgs.clear();
argList::validArgs.append("CHEMKINIIIFile"); argList::validArgs.append("CHEMKINIIIFile");
argList::addOption("thermo", "fileName"); argList::addOption("thermo", "fileName");
argList args(argc, argv); argList args(argc, argv);

View File

@ -38,7 +38,7 @@ Description
E.g. to allow all faces on same patch to be merged: E.g. to allow all faces on same patch to be merged:
combinePatchFaces .. cavity 180 -concaveAngle 90 combinePatchFaces 180 -concaveAngle 90
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -429,15 +429,18 @@ int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H" # include "addOverwriteOption.H"
argList::validArgs.append("feature angle [0..180]"); argList::validArgs.append("featureAngle [0..180]");
argList::addOption argList::addOption
( (
"concaveAngle", "concaveAngle",
"[0..180]", "degrees",
"specify concave angle [0..180] degrees (default: 30.0 degrees)" "specify concave angle [0..180] (default: 30 degrees)"
);
argList::addBoolOption
(
"snapMesh",
"use system/snapMeshDict"
); );
argList::addBoolOption("snapMesh");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -51,7 +51,13 @@ int main(int argc, char *argv[])
argList::validArgs.append("patchName"); argList::validArgs.append("patchName");
argList::validArgs.append("edgeWeight"); argList::validArgs.append("edgeWeight");
argList::addOption("useSet", "cellSet"); argList::addOption
(
"useSet",
"name",
"restrict cells to refine based on specified cellSet name"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -96,7 +96,11 @@ bool limitRefinementLevel
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("readLevel"); argList::addBoolOption
(
"readLevel",
"read level from refinementLevel file"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -109,7 +113,7 @@ int main(int argc, char *argv[])
<< " to allow for some truncation error." << " to allow for some truncation error."
<< nl << endl; << nl << endl;
bool readLevel = args.optionFound("readLevel"); const bool readLevel = args.optionFound("readLevel");
const scalarField& vols = mesh.cellVolumes(); const scalarField& vols = mesh.cellVolumes();

View File

@ -517,12 +517,30 @@ void collectCuts
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"split cells with flat faces"
);
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::addOption("set", "cellSet name"); argList::validArgs.append("edgeAngle [0..360]");
argList::addBoolOption("geometry");
argList::addOption("tol", "edge snap tolerance"); argList::addOption
argList::validArgs.append("edge angle [0..360]"); (
"set",
"name",
"split cells from specified cellSet only"
);
argList::addBoolOption
(
"geometry",
"use geometric cut for hexes as well"
);
argList::addOption
(
"tol",
"scalar", "edge snap tolerance (default 0.2)"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -538,7 +556,7 @@ int main(int argc, char *argv[])
const bool geometry = args.optionFound("geometry"); const bool geometry = args.optionFound("geometry");
const bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); const scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
Info<< "Trying to split cells with internal angles > feature angle\n" << nl Info<< "Trying to split cells with internal angles > feature angle\n" << nl
<< "featureAngle : " << featureAngle << nl << "featureAngle : " << featureAngle << nl

View File

@ -235,7 +235,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("ANSYS input file"); argList::validArgs.append("ANSYS input file");
argList::addOption("scale", "scale factor"); argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv); argList args(argc, argv);
@ -244,8 +249,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = 1.0; const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H" # include "createTime.H"

View File

@ -49,7 +49,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("CFX geom file"); argList::validArgs.append("CFX geom file");
argList::addOption("scale", "scale factor"); argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv); argList args(argc, argv);
@ -58,8 +63,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = 1.0; const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H" # include "createTime.H"

View File

@ -761,10 +761,30 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("Fluent mesh file"); argList::validArgs.append("Fluent mesh file");
argList::addOption("scale", "scale factor"); argList::addOption
argList::addOption("ignoreCellGroups", "cell group names"); (
argList::addOption("ignoreFaceGroups", "face group names"); "scale",
argList::addBoolOption("cubit"); "factor",
"geometry scaling factor - default is 1"
);
argList::addOption
(
"ignoreCellGroups",
"names",
"specify cell groups to ignore"
);
argList::addOption
(
"ignoreFaceGroups",
"names",
"specify face groups to ignore"
);
argList::addBoolOption
(
"cubit",
"special parsing of (incorrect) cubit files"
);
argList args(argc, argv); argList args(argc, argv);

View File

@ -20,8 +20,7 @@ Notes for fluentMeshToFoam with zone preservation
with the cellZones(), faceZones() and pointZones() member functions with the cellZones(), faceZones() and pointZones() member functions
- Example (Members from polyMesh.H and ZoneMesh.H): - Example (Members from polyMesh.H and ZoneMesh.H):
label thisCellZoneID = mesh.cellZones().findZoneID("thisZoneName"); const labelList& thisCellZone = mesh.cellZones()["thisZoneName"];
const labelList& thisCellZone = mesh.cellZones()[thisCellZoneID];
- Zone integrity is preserved during mesh modification and decompomposition. - Zone integrity is preserved during mesh modification and decompomposition.

View File

@ -866,9 +866,22 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("Fluent mesh file"); argList::validArgs.append("Fluent mesh file");
argList::addOption("scale", "scale factor"); argList::addOption
argList::addBoolOption("writeSets"); (
argList::addBoolOption("writeZones"); "scale",
"factor",
"geometry scaling factor - default is 1"
);
argList::addBoolOption
(
"writeSets",
"write cell zones and patches as sets"
);
argList::addBoolOption
(
"writeZones",
"write cell zones as zones"
);
argList args(argc, argv); argList args(argc, argv);
@ -877,8 +890,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = 1.0; const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
args.optionReadIfPresent("scale", scaleFactor);
const bool writeSets = args.optionFound("writeSets"); const bool writeSets = args.optionFound("writeSets");
const bool writeZones = args.optionFound("writeZones"); const bool writeZones = args.optionFound("writeZones");

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
( (
"scale", "scale",
"factor", "factor",
"specify geometry scaling factor - default is 1000 ([m] to [mm])" "geometry scaling factor - default is 1000 ([m] to [mm])"
); );
argList::addBoolOption argList::addBoolOption
( (

View File

@ -61,8 +61,8 @@ int main(int argc, char *argv[])
argList::addOption argList::addOption
( (
"scale", "scale",
"scale", "factor",
"specify geometry scaling factor" "geometry scaling factor - default is 1"
); );
argList::addBoolOption argList::addBoolOption
( (

View File

@ -628,7 +628,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("GAMBIT file"); argList::validArgs.append("GAMBIT file");
argList::addOption("scale", "scale factor"); argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv); argList args(argc, argv);
@ -637,8 +642,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = 1.0; const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H" # include "createTime.H"

View File

@ -716,7 +716,11 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append(".msh file"); argList::validArgs.append(".msh file");
argList::addBoolOption("keepOrientation"); argList::addBoolOption
(
"keepOrientation",
"retain raw orientation for prisms/hexs"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -46,7 +46,7 @@ Description
using namespace Foam; using namespace Foam;
// Supported KIVA versions //- Supported KIVA versions
enum kivaVersions enum kivaVersions
{ {
kiva3, kiva3,
@ -59,37 +59,51 @@ enum kivaVersions
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::addOption("file", "fileName"); argList::addOption
argList::addOption("version", "[kiva3|kiva3v]"); (
argList::addOption("zHeadMin", "scalar"); "file",
"name",
"specify alternative input file name - default is otape17"
);
argList::addOption
(
"version",
"version",
"specify kiva version [kiva3|kiva3v] - default is '3v'"
);
argList::addOption
(
"zHeadMin",
"scalar",
"minimum z-height for transferring liner faces to cylinder-head"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
fileName kivaFileName("otape17"); const fileName kivaFileName =
args.optionReadIfPresent("file", kivaFileName); args.optionLookupOrDefault<fileName>("file", "otape17");
kivaVersions kivaVersion = kiva3v; kivaVersions kivaVersion = kiva3v;
if (args.optionFound("version")) if (args.optionFound("version"))
{ {
const word kivaVersionName = args["version"]; const word versionName = args["version"];
if (kivaVersionName == "kiva3") if (versionName == "kiva3")
{ {
kivaVersion = kiva3; kivaVersion = kiva3;
} }
else if (kivaVersionName == "kiva3v") else if (versionName == "kiva3v")
{ {
kivaVersion = kiva3v; kivaVersion = kiva3v;
} }
else else
{ {
FatalErrorIn("main(int argc, char *argv[])") FatalErrorIn("main(int argc, char *argv[])")
<< "KIVA file version " << kivaVersionName << " not supported" << "KIVA file version " << versionName << " not supported"
<< exit(FatalError); << exit(FatalError);
args.printUsage(); args.printUsage();
FatalError.exit(1); FatalError.exit(1);
} }
} }

View File

@ -315,7 +315,7 @@ for (label i=0; i<nPoints; i++)
} }
} }
// Tranfer liner faces that are above the minimum cylinder-head z height // Transfer liner faces that are above the minimum cylinder-head z height
// into the cylinder-head region // into the cylinder-head region
if if
( (

View File

@ -56,7 +56,11 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append(".msh file"); argList::validArgs.append(".msh file");
argList::addBoolOption("hex"); argList::addBoolOption
(
"hex",
"treat input as containing hex instead of tet cells"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -69,11 +73,11 @@ int main(int argc, char *argv[])
if (readHex) if (readHex)
{ {
Info<< "Trying to read " << nCells << " hexes." << endl << endl; Info<< "Trying to read " << nCells << " hexes." << nl << endl;
} }
else else
{ {
Info<< "Trying to read " << nCells << " tets." << endl << endl; Info<< "Trying to read " << nCells << " tets." << nl << endl;
} }
cellShapeList cells(nCells); cellShapeList cells(nCells);

View File

@ -57,10 +57,28 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("PLOT3D geom file"); argList::validArgs.append("PLOT3D geom file");
argList::addOption("scale", "scale factor"); argList::addOption
argList::addBoolOption("noBlank"); (
argList::addBoolOption("singleBlock"); "scale",
argList::addOption("2D", "thickness"); "factor",
"geometry scaling factor - default is 1"
);
argList::addBoolOption
(
"noBlank",
"skip blank items"
);
argList::addBoolOption
(
"singleBlock",
"input is a single block"
);
argList::addOption
(
"2D",
"thickness",
"use when converting a 2-D geometry"
);
argList args(argc, argv); argList args(argc, argv);
@ -69,8 +87,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = 1.0; const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
args.optionReadIfPresent("scale", scaleFactor);
bool readBlank = !args.optionFound("noBlank"); bool readBlank = !args.optionFound("noBlank");
bool singleBlock = args.optionFound("singleBlock"); bool singleBlock = args.optionFound("singleBlock");

View File

@ -356,7 +356,7 @@ int main(int argc, char *argv[])
argList::noParallel(); argList::noParallel();
timeSelector::addOptions(true, false); timeSelector::addOptions(true, false);
argList::validArgs.append("feature angle[0-180]"); argList::validArgs.append("featureAngle [0-180]");
argList::addBoolOption argList::addBoolOption
( (
"splitAllFaces", "splitAllFaces",

View File

@ -40,7 +40,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("SAMM mesh file prefix"); argList::validArgs.append("SAMM mesh file prefix");
argList::addOption("scale", "scale factor"); argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv); argList args(argc, argv);
@ -49,7 +54,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
# include "createTime.H" # include "createTime.H"

View File

@ -40,7 +40,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.append("STAR mesh file prefix"); argList::validArgs.append("STAR mesh file prefix");
argList::addOption("scale", "scale factor"); argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv); argList args(argc, argv);
@ -49,7 +54,7 @@ int main(int argc, char *argv[])
FatalError.exit(); FatalError.exit();
} }
scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
# include "createTime.H" # include "createTime.H"

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
argList::addOption argList::addOption
( (
"scale", "scale",
"scale", "factor",
"geometry scaling factor - default is 0.001 ([mm] to [m])" "geometry scaling factor - default is 0.001 ([mm] to [m])"
); );
argList::addBoolOption argList::addBoolOption

View File

@ -97,7 +97,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::validArgs.append("file prefix"); argList::validArgs.append("file prefix");
argList::addBoolOption("noFaceFile"); argList::addBoolOption
(
"noFaceFile",
"skip reading .face file for boundary information"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -371,27 +371,65 @@ void writePointCells
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"for mesh debugging: write mesh as separate OBJ files"
);
timeSelector::addOptions(); timeSelector::addOptions();
argList::addBoolOption("patchFaces"); argList::addBoolOption
argList::addBoolOption("patchEdges"); (
argList::addOption("cell", "cellI"); "patchFaces",
argList::addOption("face", "faceI"); "write patch faces edges"
argList::addOption("point", "pointI"); );
argList::addOption("cellSet", "setName"); argList::addBoolOption
argList::addOption("faceSet", "setName"); (
"patchEdges",
"write patch boundary edges"
);
argList::addOption
(
"cell",
"int",
"write points for the specified cell"
);
argList::addOption
(
"face",
"int",
"write specified face"
);
argList::addOption
(
"point",
"int",
"write specified point"
);
argList::addOption
(
"cellSet",
"name",
"write points for specified cellSet"
);
argList::addOption
(
"faceSet",
"name",
"write points for specified faceSet"
);
#include "addRegionOption.H" #include "addRegionOption.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
bool patchFaces = args.optionFound("patchFaces"); const bool patchFaces = args.optionFound("patchFaces");
bool patchEdges = args.optionFound("patchEdges"); const bool patchEdges = args.optionFound("patchEdges");
bool doCell = args.optionFound("cell"); const bool doCell = args.optionFound("cell");
bool doPoint = args.optionFound("point"); const bool doPoint = args.optionFound("point");
bool doFace = args.optionFound("face"); const bool doFace = args.optionFound("face");
bool doCellSet = args.optionFound("cellSet"); const bool doCellSet = args.optionFound("cellSet");
bool doFaceSet = args.optionFound("faceSet"); const bool doFaceSet = args.optionFound("faceSet");
Info<< "Writing mesh objects as .obj files such that the object" Info<< "Writing mesh objects as .obj files such that the object"
@ -465,7 +503,6 @@ int main(int argc, char *argv[])
<< endl; << endl;
writePoints(mesh, cells.toc(), runTime.timeName()); writePoints(mesh, cells.toc(), runTime.timeName());
} }
if (doFaceSet) if (doFaceSet)
{ {

View File

@ -42,7 +42,7 @@ Usage
Specify an alternative mesh region. Specify an alternative mesh region.
@param -dict \<filename\> \n @param -dict \<filename\> \n
Specify an alternative dictionary for the block mesh description. Specify alternative dictionary for the block mesh description.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -80,7 +80,7 @@ int main(int argc, char *argv[])
( (
"dict", "dict",
"file", "file",
"specify an alternative dictionary for the blockMesh description" "specify alternative dictionary for the blockMesh description"
); );
# include "addRegionOption.H" # include "addRegionOption.H"

View File

@ -27,10 +27,7 @@
// Master patch // Master patch
const word masterPatchName(mergePatchPairs[pairI].first()); const word masterPatchName(mergePatchPairs[pairI].first());
const polyPatch& masterPatch = const polyPatch& masterPatch =
mesh.boundaryMesh() mesh.boundaryMesh()[masterPatchName];
[
mesh.boundaryMesh().findPatchID(masterPatchName)
];
labelList isf(masterPatch.size()); labelList isf(masterPatch.size());
@ -51,10 +48,7 @@
// Slave patch // Slave patch
const word slavePatchName(mergePatchPairs[pairI].second()); const word slavePatchName(mergePatchPairs[pairI].second());
const polyPatch& slavePatch = const polyPatch& slavePatch =
mesh.boundaryMesh() mesh.boundaryMesh()[slavePatchName];
[
mesh.boundaryMesh().findPatchID(slavePatchName)
];
labelList osf(slavePatch.size()); labelList osf(slavePatch.size());

View File

@ -123,7 +123,7 @@ void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName)
label findPatchID(const polyBoundaryMesh& patches, const word& name) label findPatchID(const polyBoundaryMesh& patches, const word& name)
{ {
label patchID = patches.findPatchID(name); const label patchID = patches.findPatchID(name);
if (patchID == -1) if (patchID == -1)
{ {

View File

@ -632,7 +632,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("thickness"); argList::validArgs.append("thickness");
#include "addRegionOption.H" #include "addRegionOption.H"
argList::validOptions.insert("overwrite", ""); #include "addOverwriteOption.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
@ -849,8 +849,7 @@ int main(int argc, char *argv[])
nExtrudeFaces = 0; nExtrudeFaces = 0;
forAll(zoneNames, i) forAll(zoneNames, i)
{ {
label zoneI = faceZones.findZoneID(zoneNames[i]); const faceZone& fz = faceZones[zoneNames[i]];
const faceZone& fz = faceZones[zoneI];
forAll(fz, j) forAll(fz, j)
{ {
extrudeTopPatchID[nExtrudeFaces] = interRegionTopPatch[i]; extrudeTopPatchID[nExtrudeFaces] = interRegionTopPatch[i];

View File

@ -48,9 +48,21 @@ int main(int argc, char *argv[])
{ {
timeSelector::addOptions(); timeSelector::addOptions();
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addBoolOption("noTopology"); argList::addBoolOption
argList::addBoolOption("allGeometry"); (
argList::addBoolOption("allTopology"); "noTopology",
"skip checking the mesh topology"
);
argList::addBoolOption
(
"allGeometry",
"include bounding box checks"
);
argList::addBoolOption
(
"allTopology",
"include extra topology checks"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -107,7 +107,7 @@ void modifyOrAddFace
label findPatchID(const polyMesh& mesh, const word& name) label findPatchID(const polyMesh& mesh, const word& name)
{ {
label patchI = mesh.boundaryMesh().findPatchID(name); const label patchI = mesh.boundaryMesh().findPatchID(name);
if (patchI == -1) if (patchI == -1)
{ {
@ -124,18 +124,35 @@ label findPatchID(const polyMesh& mesh, const word& name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"Makes internal faces into boundary faces.\n"
"Does not duplicate points, unlike mergeOrSplitBaffles."
);
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
argList::validArgs.append("faceZone"); argList::validArgs.append("faceZone");
argList::validArgs.append("patch"); argList::validArgs.append("patch");
argList::addOption("additionalPatches", "(patch2 .. patchN)");
argList::addBoolOption("internalFacesOnly"); argList::addOption
(
"additionalPatches",
"(patch2 .. patchN)",
"specify additional patches for creating baffles"
);
argList::addBoolOption
(
"internalFacesOnly",
"do not convert boundary faces"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();

View File

@ -681,17 +681,17 @@ int main(int argc, char *argv[])
{ {
const dictionary& dict = patchSources[addedI]; const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name")); const word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName); label destPatchI = patches.findPatchID(patchName);
if (destPatchI == -1) if (destPatchI == -1)
{ {
FatalErrorIn(args.executable()) << "patch " << patchName FatalErrorIn(args.executable())
<< " not added. Problem." << abort(FatalError); << "patch " << patchName << " not added. Problem."
<< abort(FatalError);
} }
word sourceType(dict.lookup("constructFrom")); const word sourceType(dict.lookup("constructFrom"));
if (sourceType == "patches") if (sourceType == "patches")
{ {
@ -719,7 +719,7 @@ int main(int argc, char *argv[])
} }
else if (sourceType == "set") else if (sourceType == "set")
{ {
word setName(dict.lookup("set")); const word setName(dict.lookup("set"));
faceSet faces(mesh, setName); faceSet faces(mesh, setName);

View File

@ -1,15 +1,22 @@
Info<< nl << "Create Times" << endl; Info<< nl << "Create Times" << endl;
const fileName masterCasePath = masterCase.path();
const fileName masterCaseName = masterCase.name();
Time runTimeMaster Time runTimeMaster
( (
Time::controlDictName, Time::controlDictName,
rootDirMaster, masterCasePath,
caseDirMaster masterCaseName
); );
const fileName addCasePath = addCase.path();
const fileName addCaseName = addCase.name();
Time runTimeToAdd Time runTimeToAdd
( (
Time::controlDictName, Time::controlDictName,
rootDirToAdd, addCasePath,
caseDirToAdd addCaseName
); );

View File

@ -32,16 +32,74 @@ Description
using namespace Foam; using namespace Foam;
void getRootCase(fileName& casePath)
{
casePath.clean();
if (casePath.empty() || casePath == ".")
{
// handle degenerate form and '.'
casePath = cwd();
}
else if (casePath[0] != '/' && casePath.name() == "..")
{
// avoid relative cases ending in '..' - makes for very ugly names
casePath = cwd()/casePath;
casePath.clean();
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"merge two meshes"
);
argList::noParallel(); argList::noParallel();
# include "setRoots.H" argList::validArgs.append("masterCase");
argList::addOption
(
"masterRegion",
"name",
"specify alternative mesh region for the master mesh"
);
argList::validArgs.append("addCase");
argList::addOption
(
"addRegion",
"name",
"specify alternative mesh region for the additional mesh"
);
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
fileName masterCase = args[1];
word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion);
fileName addCase = args[2];
word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion);
getRootCase(masterCase);
getRootCase(addCase);
Info<< "Master: " << masterCase << " region " << masterRegion << nl
<< "mesh to add: " << addCase << " region " << addRegion << endl;
#include "createTimes.H" #include "createTimes.H"
Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << endl; Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << nl;
Info<< "Create mesh\n" << endl; Info<< "Create mesh\n" << endl;
mergePolyMesh masterMesh mergePolyMesh masterMesh
@ -55,7 +113,7 @@ int main(int argc, char *argv[])
); );
Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << endl; Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << nl;
Info<< "Create mesh\n" << endl; Info<< "Create mesh\n" << endl;
polyMesh meshToAdd polyMesh meshToAdd

View File

@ -1,32 +0,0 @@
argList::validArgs.clear();
argList::validArgs.append("master root");
argList::validArgs.append("master case");
argList::addOption("masterRegion", "name");
argList::validArgs.append("root to add");
argList::validArgs.append("case to add");
argList::addOption("addRegion", "name");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
fileName rootDirMaster = args[1];
fileName caseDirMaster = args[2];
word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion);
fileName rootDirToAdd = args[3];
fileName caseDirToAdd = args[4];
word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion);
Info<< "Master: " << rootDirMaster << " " << caseDirMaster
<< " region " << masterRegion << nl
<< "mesh to add: " << rootDirToAdd << " " << caseDirToAdd
<< " region " << addRegion << endl;

View File

@ -221,15 +221,30 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"Detect faces that share points (baffles).\n"
"Merge them or duplicate the points."
);
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addBoolOption("split"); argList::addBoolOption
argList::addBoolOption("detectOnly"); (
"detectOnly",
"find baffles only, but do not merge or split them"
);
argList::addBoolOption
(
"split",
"topologically split duplicate surfaces"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const bool split = args.optionFound("split"); const bool split = args.optionFound("split");
@ -248,12 +263,10 @@ int main(int argc, char *argv[])
if (detectOnly) if (detectOnly)
{ {
findBaffles(mesh, boundaryFaces); findBaffles(mesh, boundaryFaces);
return 0; return 0;
} }
// Read objects in time directory // Read objects in time directory
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());

View File

@ -110,7 +110,6 @@ labelList parseVertices(const string& line)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("OBJ file"); argList::validArgs.append("OBJ file");
argList::validArgs.append("output VTK file"); argList::validArgs.append("output VTK file");
argList args(argc, argv); argList args(argc, argv);

View File

@ -290,8 +290,17 @@ label twoDNess(const polyMesh& mesh)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"refine cells in multiple directions"
);
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
argList::addBoolOption("dict"); argList::addBoolOption
(
"dict",
"refine according to system/refineMeshDict"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -301,7 +310,6 @@ int main(int argc, char *argv[])
printEdgeStats(mesh); printEdgeStats(mesh);
// //
// Read/construct control dictionary // Read/construct control dictionary
// //

View File

@ -363,9 +363,21 @@ autoPtr<mapPolyMesh> reorderMesh
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("blockOrder"); argList::addBoolOption
argList::addBoolOption("orderPoints"); (
argList::addBoolOption("writeMaps"); "blockOrder",
"order cells into regions (using decomposition)"
);
argList::addBoolOption
(
"orderPoints",
"order points into internal and boundary points"
);
argList::addBoolOption
(
"writeMaps",
"write cellMap, faceMap, pointMap in polyMesh/"
);
# include "addOverwriteOption.H" # include "addOverwriteOption.H"
# include "addTimeOptions.H" # include "addTimeOptions.H"

View File

@ -828,7 +828,12 @@ int main(int argc, char *argv[])
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addBoolOption("noVTK", "do not write VTK files"); argList::addBoolOption("noVTK", "do not write VTK files");
argList::addBoolOption("loop", "execute batch commands for all timesteps"); argList::addBoolOption("loop", "execute batch commands for all timesteps");
argList::addOption("batch", "file"); argList::addOption
(
"batch",
"file",
"process in batch mode, using input from specified file"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -57,14 +57,23 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("noFlipMap"); argList::addNote
(
"add point/face/cell Zones from similar named point/face/cell Sets"
);
argList::addBoolOption
(
"noFlipMap",
"ignore orientation of faceSet"
);
#include "addRegionOption.H" #include "addRegionOption.H"
#include "addTimeOptions.H" #include "addTimeOptions.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
bool noFlipMap = args.optionFound("noFlipMap"); const bool noFlipMap = args.optionFound("noFlipMap");
// Get times list // Get times list
instantList Times = runTime.times(); instantList Times = runTime.times();
@ -153,9 +162,19 @@ int main(int argc, char *argv[])
DynamicList<label> addressing(set.size()); DynamicList<label> addressing(set.size());
DynamicList<bool> flipMap(set.size()); DynamicList<bool> flipMap(set.size());
if (!noFlipMap) if (noFlipMap)
{ {
word setName(set.name() + "SlaveCells"); // No flip map.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
addressing.append(faceI);
flipMap.append(false);
}
}
else
{
const word setName(set.name() + "SlaveCells");
Info<< "Trying to load cellSet " << setName Info<< "Trying to load cellSet " << setName
<< " to find out the slave side of the zone." << nl << " to find out the slave side of the zone." << nl
@ -226,16 +245,6 @@ int main(int argc, char *argv[])
flipMap.append(flip); flipMap.append(flip);
} }
} }
else
{
// No flip map.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
addressing.append(faceI);
flipMap.append(false);
}
}
label zoneID = mesh.faceZones().findZoneID(set.name()); label zoneID = mesh.faceZones().findZoneID(set.name());
if (zoneID == -1) if (zoneID == -1)

View File

@ -85,12 +85,12 @@ label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
// Checks whether patch present // Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name) void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{ {
label patchI = bMesh.findPatchID(name); const label patchI = bMesh.findPatchID(name);
if (patchI == -1) if (patchI == -1)
{ {
FatalErrorIn("checkPatch(const polyBoundaryMesh&, const word&)") FatalErrorIn("checkPatch(const polyBoundaryMesh&, const word&)")
<< "Cannot find patch " << name << endl << "Cannot find patch " << name << nl
<< "It should be present but of zero size" << endl << "It should be present but of zero size" << endl
<< "Valid patches are " << bMesh.names() << "Valid patches are " << bMesh.names()
<< exit(FatalError); << exit(FatalError);

View File

@ -1473,21 +1473,59 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
} }
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"splits mesh into multiple regions"
);
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
argList::addBoolOption("cellZones"); argList::addBoolOption
argList::addBoolOption("cellZonesOnly"); (
argList::addOption("cellZonesFileOnly", "cellZonesName"); "cellZones"
argList::addOption("blockedFaces", "faceSet"); );
argList::addBoolOption("makeCellZones"); argList::addBoolOption
argList::addBoolOption("largestOnly"); (
argList::addOption("insidePoint", "point"); "cellZonesOnly",
argList::addBoolOption("detectOnly"); "use current cellZones to split mesh into regions"
argList::addBoolOption("sloppyCellZones"); );
argList::addOption
(
"cellZonesFileOnly",
"file",
"like -cellZonesOnly, but use specified file"
);
argList::addOption
(
"blockedFaces",
"faceSet"
);
argList::addBoolOption
(
"makeCellZones",
"place cells into cellZones instead of splitting mesh"
);
argList::addBoolOption
(
"largestOnly"
);
argList::addOption
(
"insidePoint",
"point"
);
argList::addBoolOption
(
"detectOnly",
"do not write mesh"
);
argList::addBoolOption
(
"sloppyCellZones",
"try to match regions to existing cell zones"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -1514,10 +1552,7 @@ int main(int argc, char *argv[])
if if
( (
(useCellZonesOnly || useCellZonesFile) (useCellZonesOnly || useCellZonesFile)
&& ( && (useCellZones || blockedFacesName.size())
blockedFacesName != word::null
|| useCellZones
)
) )
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
@ -1529,7 +1564,6 @@ int main(int argc, char *argv[])
} }
if (insidePoint && largestOnly) if (insidePoint && largestOnly)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
@ -1719,7 +1753,6 @@ int main(int argc, char *argv[])
writeCellToRegion(mesh, cellRegion); writeCellToRegion(mesh, cellRegion);
// Sizes per region // Sizes per region
// ~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~

View File

@ -40,6 +40,7 @@ Description
Comparable to running a meshModifier of the form Comparable to running a meshModifier of the form
(if masterPatch is called "M" and slavePatch "S"): (if masterPatch is called "M" and slavePatch "S"):
@verbatim
couple couple
{ {
type slidingInterface; type slidingInterface;
@ -51,6 +52,7 @@ Description
slavePatchName S; slavePatchName S;
typeOfMatch partial or integral typeOfMatch partial or integral
} }
@endverbatim
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -168,7 +170,7 @@ label addCellZone(const polyMesh& mesh, const word& name)
// Checks whether patch present // Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name) void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{ {
label patchI = bMesh.findPatchID(name); const label patchI = bMesh.findPatchID(name);
if (patchI == -1) if (patchI == -1)
{ {
@ -192,6 +194,12 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"merge the faces on the specified patches (if geometrically possible)\n"
"so the faces become internal"
);
argList::noParallel(); argList::noParallel();
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
@ -199,15 +207,28 @@ int main(int argc, char *argv[])
argList::validArgs.append("masterPatch"); argList::validArgs.append("masterPatch");
argList::validArgs.append("slavePatch"); argList::validArgs.append("slavePatch");
argList::addBoolOption("partial"); argList::addBoolOption
argList::addBoolOption("perfect"); (
"partial",
argList::addOption("toleranceDict", "file with tolerances"); "couple partially overlapping patches"
);
argList::addBoolOption
(
"perfect",
"couple perfectly aligned patches"
);
argList::addOption
(
"toleranceDict",
"file",
"dictionary file with tolerances"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const word masterPatchName = args[1]; const word masterPatchName = args[1];
@ -220,7 +241,7 @@ int main(int argc, char *argv[])
if (partialCover && perfectCover) if (partialCover && perfectCover)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Cannot both supply partial and perfect." << endl << "Cannot supply both partial and perfect." << endl
<< "Use perfect match option if the patches perfectly align" << "Use perfect match option if the patches perfectly align"
<< " (both vertex positions and face centres)" << endl << " (both vertex positions and face centres)" << endl
<< exit(FatalError); << exit(FatalError);
@ -291,11 +312,7 @@ int main(int argc, char *argv[])
// Create and add face zones and mesh modifiers // Create and add face zones and mesh modifiers
// Master patch // Master patch
const polyPatch& masterPatch = const polyPatch& masterPatch = mesh.boundaryMesh()[masterPatchName];
mesh.boundaryMesh()
[
mesh.boundaryMesh().findPatchID(masterPatchName)
];
// Make list of masterPatch faces // Make list of masterPatch faces
labelList isf(masterPatch.size()); labelList isf(masterPatch.size());
@ -352,11 +369,7 @@ int main(int argc, char *argv[])
); );
// Slave patch // Slave patch
const polyPatch& slavePatch = const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName];
mesh.boundaryMesh()
[
mesh.boundaryMesh().findPatchID(slavePatchName)
];
labelList osf(slavePatch.size()); labelList osf(slavePatch.size());

View File

@ -150,14 +150,25 @@ void subsetPointFields
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H" argList::addNote
argList::validArgs.append("set"); (
argList::addOption("patch", "patch name"); "select a mesh subset based on a cellSet"
);
#include "addOverwriteOption.H"
argList::validArgs.append("cellSet");
argList::addOption
(
"patch",
"name",
"add exposed internal faces to specified patch instead of to "
"'oldInternalFaces'"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
#include "createMesh.H" #include "createMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const word setName = args[1]; const word setName = args[1];
@ -190,7 +201,7 @@ int main(int argc, char *argv[])
else else
{ {
Info<< "Adding exposed internal faces to a patch called" Info<< "Adding exposed internal faces to a patch called"
<< " \"oldInternalFaces\" (created if nessecary)" << endl << " \"oldInternalFaces\" (created if necessary)" << endl
<< endl; << endl;
} }

View File

@ -44,7 +44,6 @@ int main(int argc, char *argv[])
{ {
argList::noBanner(); argList::noBanner();
argList::noParallel(); argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("inputDict"); argList::validArgs.append("inputDict");
argList args(argc, argv); argList args(argc, argv);

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Interrogates a case and prints information to screen Interrogates a case and prints information to stdout
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -38,16 +38,34 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"interrogates a case and prints information to stdout"
);
argList::noBanner();
argList::noParallel(); argList::noParallel();
argList::addBoolOption("times"); argList::addBoolOption("times", "list available times");
argList::addOption("dictionary", "dictionary name"); argList::addBoolOption
argList::addBoolOption("keywords"); (
argList::addOption("entry", "entry name"); "keywords",
"report keywords for the specified dictionary"
);
argList::addOption
(
"dict",
"file",
"specify a dictionary to interrogate"
);
argList::addOption
(
"entry",
"name",
"report the named entry for the specified dictionary"
);
#include "setRootCase.H" #include "setRootCase.H"
Info<< endl;
if (args.optionFound("times")) if (args.optionFound("times"))
{ {
instantList times instantList times
@ -61,11 +79,11 @@ int main(int argc, char *argv[])
} }
} }
if (args.optionFound("dictionary")) if (args.optionFound("dict"))
{ {
fileName dictFileName const fileName dictFileName
( (
args.rootPath()/args.caseName()/args["dictionary"] args.rootPath()/args.caseName()/args["dict"]
); );
IFstream dictFile(dictFileName); IFstream dictFile(dictFileName);
@ -74,14 +92,7 @@ int main(int argc, char *argv[])
{ {
dictionary dict(dictFile); dictionary dict(dictFile);
if (args.optionFound("keywords") && !args.optionFound("entry")) if (args.optionFound("entry"))
{
forAllConstIter(dictionary, dict, iter)
{
Info<< iter().keyword() << endl;
}
}
else if (args.optionFound("entry"))
{ {
wordList entryNames wordList entryNames
( (
@ -152,6 +163,13 @@ int main(int argc, char *argv[])
FatalError.exit(2); FatalError.exit(2);
} }
} }
else if (args.optionFound("keywords"))
{
forAllConstIter(dictionary, dict, iter)
{
Info<< iter().keyword() << endl;
}
}
else else
{ {
Info<< dict; Info<< dict;

View File

@ -81,6 +81,11 @@ Usage
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"decompose a mesh and fields of a case for parallel execution"
);
argList::noParallel(); argList::noParallel();
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addBoolOption argList::addBoolOption
@ -110,11 +115,6 @@ int main(int argc, char *argv[])
"only decompose geometry if the number of domains has changed" "only decompose geometry if the number of domains has changed"
); );
argList::addNote
(
"decompose a mesh and fields of a case for parallel execution"
);
#include "setRootCase.H" #include "setRootCase.H"
word regionName = fvMesh::defaultRegion; word regionName = fvMesh::defaultRegion;

View File

@ -55,7 +55,7 @@ void Foam::domainDecomposition::distributeCells()
forAll(pNames, i) forAll(pNames, i)
{ {
label patchI = patches.findPatchID(pNames[i]); const label patchI = patches.findPatchID(pNames[i]);
if (patchI == -1) if (patchI == -1)
{ {

View File

@ -279,6 +279,11 @@ autoPtr<mapPolyMesh> mergeSharedPoints
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"reconstruct a mesh using geometric information only"
);
argList::noParallel(); argList::noParallel();
argList::addOption argList::addOption
( (
@ -293,11 +298,6 @@ int main(int argc, char *argv[])
"do (slower) geometric matching on all boundary faces" "do (slower) geometric matching on all boundary faces"
); );
argList::addNote
(
"reconstruct a mesh using geometric information only"
);
#include "addTimeOptions.H" #include "addTimeOptions.H"
#include "addRegionOption.H" #include "addRegionOption.H"
#include "setRootCase.H" #include "setRootCase.H"

View File

@ -503,7 +503,13 @@ void compareFields
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addOption("mergeTol", "relative merge distance"); argList::addOption
(
"mergeTol",
"scalar",
"specify the merge distance relative to the bounding box size "
"(default 1E-6)"
);
// Create argList. This will check for non-existing processor dirs. // Create argList. This will check for non-existing processor dirs.
# include "setRootCase.H" # include "setRootCase.H"

View File

@ -341,9 +341,9 @@ int main(int argc, char *argv[])
{ {
wordList fieldNames = objects.names(volFieldTypes[i]); wordList fieldNames = objects.names(volFieldTypes[i]);
for (label j=0; j<fieldNames.size(); j++) forAll(fieldNames, j)
{ {
word fieldName = fieldNames[j]; const word& fieldName = fieldNames[j];
# include "checkData.H" # include "checkData.H"

View File

@ -176,7 +176,11 @@ static void writeFaceData
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::addBoolOption("noWall"); argList::addBoolOption
(
"noWall",
"skip setting wall information"
);
timeSelector::addOptions(true, false); timeSelector::addOptions(true, false);
# include "setRootCase.H" # include "setRootCase.H"

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