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

This commit is contained in:
mattijs
2009-02-05 15:37:32 +00:00
11 changed files with 434 additions and 2 deletions

View File

@ -0,0 +1,21 @@
{
dimensionedScalar totalMass = fvc::domainIntegrate(rho);
scalar sumLocalContErr =
(
fvc::domainIntegrate(mag(rho - thermo.rho()))/totalMass
).value();
scalar globalContErr =
(
fvc::domainIntegrate(rho - thermo.rho())/totalMass
).value();
cumulativeContErr[i] += globalContErr;
Info<< "time step continuity errors (" << mesh.name() << ")"
<< ": sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr[i]
<< endl;
}

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Calculates and outputs the mean and maximum Courant Numbers for the fluid
regions
\*---------------------------------------------------------------------------*/
#ifndef compressibleCourantNo_H
#define compressibleCourantNo_H
#include "fvMesh.H"
namespace Foam
{
scalar compressibleCourantNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& rho,
const surfaceScalarField& phi
);
}
#endif
// ************************************************************************* //

View File

@ -0,0 +1 @@
List<scalar> cumulativeContErr(fluidRegions.size(), 0.0);

View File

@ -0,0 +1,18 @@
const fvMesh& mesh = fluidRegions[i];
basicThermo& thermo = thermoFluid[i];
volScalarField& rho = rhoFluid[i];
volScalarField& K = KFluid[i];
volVectorField& U = UFluid[i];
surfaceScalarField phi = phiFluid[i];
compressible::turbulenceModel& turb = turbulence[i];
volScalarField& DpDt = DpDtFluid[i];
const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i];
volScalarField& pd = pdFluid[i];
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
const dimensionedScalar massIni("massIni", dimMass, initialMassFluid[i]);

View File

@ -0,0 +1,6 @@
// fvMesh& mesh = solidRegions[i];
volScalarField& rho = rhos[i];
volScalarField& cp = cps[i];
volScalarField& K = Ks[i];
volScalarField& T = Ts[i];

View File

@ -7,6 +7,7 @@ field/magSqr/magSqr.C
field/magGrad/magGrad.C
field/div/div.C
field/randomise/randomise.C
field/interpolate/interpolate.C
basic/add/add.C

View File

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "interpolate.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace calcTypes
{
defineTypeNameAndDebug(interpolate, 0);
addToRunTimeSelectionTable(calcType, interpolate, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::calcTypes::interpolate::interpolate()
:
calcType()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::calcTypes::interpolate::~interpolate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::calcTypes::interpolate::init()
{
Foam::argList::validArgs.append("interpolate");
argList::validArgs.append("fieldName1 .. fieldNameN");
}
void Foam::calcTypes::interpolate::preCalc
(
const argList& args,
const Time& runTime,
const fvMesh& mesh
)
{
if (args.additionalArgs().size() < 2)
{
Info<< nl << "must specify one or more fields" << nl;
args.printUsage();
FatalError.exit();
}
}
void Foam::calcTypes::interpolate::calc
(
const argList& args,
const Time& runTime,
const fvMesh& mesh
)
{
const stringList& params = args.additionalArgs();
for (label fieldi=1; fieldi<params.size(); fieldi++)
{
const word fieldName(params[fieldi]);
IOobject fieldHeader
(
fieldName,
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
// Check field exists
if (fieldHeader.headerOk())
{
bool processed = false;
writeInterpolateField<scalar>(fieldHeader, mesh, processed);
writeInterpolateField<vector>(fieldHeader, mesh, processed);
writeInterpolateField<sphericalTensor>
(
fieldHeader,
mesh,
processed
);
writeInterpolateField<symmTensor>(fieldHeader, mesh, processed);
writeInterpolateField<tensor>(fieldHeader, mesh, processed);
if (!processed)
{
FatalError
<< "Unable to process " << fieldName << nl
<< "No call to interpolate for fields of type "
<< fieldHeader.headerClassName() << nl << nl
<< exit(FatalError);
}
}
else
{
Info<< " No " << fieldName << endl;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::calcTypes::interpolate
Description
Interpolates volume fields to surface fields for each time.
SourceFiles
interpolate.C
\*---------------------------------------------------------------------------*/
#ifndef interpolate_H
#define interpolate_H
#include "calcType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace calcTypes
{
/*---------------------------------------------------------------------------*\
Class interpolate Declaration
\*---------------------------------------------------------------------------*/
class interpolate
:
public calcType
{
// Private Member Functions
//- Disallow default bitwise copy construct
interpolate(const interpolate&);
//- Disallow default bitwise assignment
void operator=(const interpolate&);
protected:
// Member Functions
// Calculation routines
//- Initialise - typically setting static variables,
// e.g. command line arguments
virtual void init();
//- Pre-time loop calculations
virtual void preCalc
(
const argList& args,
const Time& runTime,
const fvMesh& mesh
);
//- Time loop calculations
virtual void calc
(
const argList& args,
const Time& runTime,
const fvMesh& mesh
);
// I-O
//- Write interpolate fields
template<class Type>
void writeInterpolateField
(
const IOobject& header,
const fvMesh& mesh,
bool& processed
);
public:
//- Runtime type information
TypeName("interpolate");
// Constructors
//- Construct null
interpolate();
// Destructor
virtual ~interpolate();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace calcTypes
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "writeInterpolateField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
template<class Type>
void Foam::calcTypes::interpolate::writeInterpolateField
(
const IOobject& header,
const fvMesh& mesh,
bool& processed
)
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
typedef GeometricField<Type, fvsPatchField, surfaceMesh> surfaceFieldType;
if (header.headerClassName() == fieldType::typeName)
{
Info<< " Reading " << header.name() << endl;
fieldType field(header, mesh);
Info<< " Calculating interpolate" << header.name() << endl;
surfaceFieldType interpolateField
(
IOobject
(
"interpolate" + header.name(),
mesh.time().timeName(),
mesh,
IOobject::NO_READ
),
fvc::interpolate(field)
);
interpolateField.write();
processed = true;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -86,7 +86,7 @@ autoPtr<radiationModel> radiationModel::New
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End radiation
} // End namespace radiation
} // End namespace Foam
// ************************************************************************* //

View File

@ -97,7 +97,7 @@ RASModel::RASModel
dimensioned<scalar>::lookupOrAddToDict
(
"E",
wallFunctionDict_
wallFunctionDict_,
9.0
)
),