mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -39,6 +39,20 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
potential pot(mesh);
|
||||
|
||||
moleculeCloud molecules(mesh, pot);
|
||||
|
||||
@ -39,6 +39,20 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
potential pot(mesh);
|
||||
|
||||
moleculeCloud molecules(mesh, pot);
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
incompressibleUncoupledKinematicParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/incompressibleUncoupledKinematicParcelFoam
|
||||
@ -0,0 +1,27 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-lthermophysicalFunctions \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lradiation \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsurfaceFilmModels
|
||||
@ -0,0 +1,147 @@
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoInfValue
|
||||
(
|
||||
transportProperties.lookup("rhoInf")
|
||||
);
|
||||
|
||||
volScalarField rhoInf
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
rhoInfValue
|
||||
);
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
const volScalarField nu = laminarTransport.nu();
|
||||
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
nu*rhoInfValue
|
||||
);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
args.optionReadIfPresent("cloudName", kinematicCloudName);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicCloud kinematicCloud
|
||||
(
|
||||
kinematicCloudName,
|
||||
rhoInf,
|
||||
U,
|
||||
mu,
|
||||
g
|
||||
);
|
||||
|
||||
IOobject Hheader
|
||||
(
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HPtr_;
|
||||
|
||||
if (Hheader.headerOk())
|
||||
{
|
||||
Info<< "\nReading field H\n" << endl;
|
||||
|
||||
HPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"H",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
IOobject HdotGradHheader
|
||||
(
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
autoPtr<volVectorField> HdotGradHPtr_;
|
||||
|
||||
if (HdotGradHheader.headerOk())
|
||||
{
|
||||
Info<< "\nReading field HdotGradH\n" << endl;
|
||||
|
||||
HdotGradHPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"HdotGradH",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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/>.
|
||||
|
||||
Application
|
||||
uncoupledKinematicParcelFoam
|
||||
|
||||
Description
|
||||
Transient solver for the passive transport of a single kinematic
|
||||
particle could.
|
||||
|
||||
Uses a pre-calculated velocity field to evolve the cloud.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicKinematicCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addOption("cloudName", "cloud name");
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "createFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
||||
|
||||
laminarTransport.correct();
|
||||
|
||||
mu = nu*rhoInfValue;
|
||||
|
||||
kinematicCloud.evolve();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,4 +1,3 @@
|
||||
globalIndex.C
|
||||
globalIndexTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/globalIndexTest
|
||||
|
||||
@ -108,13 +108,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
List<wallPoint> allFaceInfo(mesh.nFaces());
|
||||
List<wallPoint> allCellInfo(mesh.nCells());
|
||||
|
||||
MeshWave<wallPoint> wallDistCalc
|
||||
FaceCellWave<wallPoint> wallDistCalc
|
||||
(
|
||||
mesh,
|
||||
changedFaces,
|
||||
faceDist,
|
||||
0 // max iterations
|
||||
allFaceInfo,
|
||||
allCellInfo,
|
||||
0 // max iterations
|
||||
);
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -148,16 +152,13 @@ int main(int argc, char *argv[])
|
||||
// Copy face and cell values into field
|
||||
//
|
||||
|
||||
const List<wallPoint>& cellInfo = wallDistCalc.allCellInfo();
|
||||
const List<wallPoint>& faceInfo = wallDistCalc.allFaceInfo();
|
||||
|
||||
label nIllegal = 0;
|
||||
|
||||
// Copy cell values
|
||||
forAll(cellInfo, cellI)
|
||||
forAll(allCellInfo, cellI)
|
||||
{
|
||||
scalar dist = cellInfo[cellI].distSqr();
|
||||
if (cellInfo[cellI].valid())
|
||||
scalar dist = allCellInfo[cellI].distSqr();
|
||||
if (allCellInfo[cellI].valid())
|
||||
{
|
||||
wallDistUncorrected[cellI] = Foam::sqrt(dist);
|
||||
}
|
||||
@ -178,8 +179,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const label meshFaceI = patchField.patch().start() + patchFaceI;
|
||||
|
||||
scalar dist = faceInfo[meshFaceI].distSqr();
|
||||
if (faceInfo[meshFaceI].valid())
|
||||
scalar dist = allFaceInfo[meshFaceI].distSqr();
|
||||
if (allFaceInfo[meshFaceI].valid())
|
||||
{
|
||||
patchField[patchFaceI] = Foam::sqrt(dist);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user