Commit ac49daaf authored by mattijs's avatar mattijs
Browse files

Merge remote-tracking branch 'origin/develop' into develop

Conflicts:
	applications/utilities/surface/surfaceCheck/surfaceCheck.C
parents c90e6ed4 40ed1952
......@@ -6,8 +6,6 @@
.*~
*.bak
*.bak[0-9][0-9]
*.orig
*.orig[0-9][0-9]
\#*\#
# File-browser settings - anywhere
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation without documentation by default
genDoc=0
targetType=libso
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmakeCheckPwd "$WM_PROJECT_DIR" || {
......@@ -36,11 +34,5 @@ src/Allwmake $targetType $*
# Compile OpenFOAM libraries and applications
applications/Allwmake $targetType $*
# Optionally build OpenFOAM Doxygen documentation
if [ $genDoc -eq 1 ]
then
doc/Allwmake
fi
#------------------------------------------------------------------------------
......@@ -2,7 +2,6 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
......@@ -20,8 +19,8 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
set -x
wmake -all solvers $*
wmake -all utilities $*
wmake -all $targetType solvers
wmake -all $targetType utilities
#------------------------------------------------------------------------------
#include "readTransportProperties.H"
Info<< "Reading field p\n" << endl;
volScalarField p
(
......@@ -29,3 +31,5 @@ volVectorField U
#include "createPhi.H"
mesh.setFluxRequired(p.name());
#include "readTurbulenceProperties.H"
......@@ -28,7 +28,7 @@ Group
grpDNSSolvers
Description
Direct numerical simulation solver for boxes of isotropic turbulence
Direct numerical simulation solver for boxes of isotropic turbulence.
\*---------------------------------------------------------------------------*/
......@@ -44,16 +44,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoClear.H"
pisoControl piso(mesh);
#include "readTransportProperties.H"
#include "createControl.H"
#include "createFields.H"
#include "readTurbulenceProperties.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -64,7 +61,7 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
force.internalField() = ReImSum
force.primitiveFieldRef() = ReImSum
(
fft::reverseTransform
(
......@@ -119,7 +116,7 @@ int main(int argc, char *argv[])
runTime.write();
if (runTime.outputTime())
if (runTime.writeTime())
{
calcEk(U, K).write
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -52,6 +52,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -66,6 +67,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createFvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -77,10 +79,16 @@ int main(int argc, char *argv[])
while (simple.correctNonOrthogonal())
{
solve
fvScalarMatrix TEqn
(
fvm::ddt(T) - fvm::laplacian(DT, T)
==
fvOptions(T)
);
fvOptions.constrain(TEqn);
TEqn.solve();
fvOptions.correct(T);
}
#include "write.H"
......
if (runTime.outputTime())
if (runTime.writeTime())
{
volVectorField gradT(fvc::grad(T));
......
const dictionary& potentialFlow
(
mesh.solutionDict().subDict("potentialFlow")
);
const int nNonOrthCorr
(
potentialFlow.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0)
);
......@@ -43,7 +43,7 @@ word pName("p");
// Update name of the pressure field from the command-line option
args.optionReadIfPresent("pName", pName);
// Infer the pressure BCs from the velocity BCs
// Infer the pressure BCs from the velocity
wordList pBCTypes
(
U.boundaryField().size(),
......@@ -78,62 +78,36 @@ volScalarField p
pBCTypes
);
label pRefCell = 0;
scalar pRefValue = 0.0;
if (args.optionFound("writep"))
{
setRefCell
(
p,
potentialFlow.dict(),
pRefCell,
pRefValue
);
}
Info<< "Constructing velocity potential field Phi\n" << endl;
autoPtr<volScalarField> PhiPtr;
IOobject io
// Infer the velocity potential BCs from the pressure
wordList PhiBCTypes
(
"Phi",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
if (io.typeHeaderOk<volScalarField>())
{
PhiPtr.reset(new volScalarField(io, mesh));
}
else
forAll(p.boundaryField(), patchi)
{
// Cannot just use p.boundaryField().types() since does not initialise
// complex boundary types. Instead re-clone them from p.
io.readOpt() = IOobject::NO_READ;
PhiPtr.reset
(
new volScalarField
(
io,
mesh,
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
p.boundaryField().types()
)
);
const volScalarField::GeometricBoundaryField& bp = p.boundaryField();
volScalarField::GeometricBoundaryField& bPhi = PhiPtr().boundaryField();
forAll(bp, patchI)
if (p.boundaryField()[patchi].fixesValue())
{
bPhi.set(patchI, bp[patchI].clone(PhiPtr().dimensionedInternalField()));
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField& Phi = PhiPtr();
Info<< "Constructing velocity potential field Phi\n" << endl;
volScalarField Phi
(
IOobject
(
"Phi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
PhiBCTypes
);
label PhiRefCell = 0;
scalar PhiRefValue = 0;
......@@ -145,3 +119,5 @@ setRefCell
PhiRefValue
);
mesh.setFluxRequired(Phi.name());
#include "createMRF.H"
......@@ -28,7 +28,9 @@ Group
grpBasicSolvers
Description
Potential flow solver.
Potential flow solver which solves for the velocity potential, to
calculate the flux-field, from which the velocity field is obtained by
reconstructing the flux.
\heading Solver details
The potential flow solution is typically employed to generate initial fields
......@@ -130,7 +132,6 @@ int main(int argc, char *argv[])
pisoControl potentialFlow(mesh, "potentialFlow");
#include "createFields.H"
#include "createMRF.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -87,17 +87,16 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "createControl.H"
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFieldRefs.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
......@@ -113,7 +112,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "createTimeControls.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "createTimeControls.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -131,11 +131,11 @@ int main(int argc, char *argv[])
protectedCell = 0;
}
forAll(betav, cellI)
forAll(betav, celli)
{
if (betav[cellI] < 0.99)
if (betav[celli] < 0.99)
{
protectedCell[cellI] = 1;
protectedCell[celli] = 1;
}
}
......
......@@ -105,7 +105,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0)
);
N.internalField() = Nv.internalField()*Cw;
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
volSymmTensorField ns
(
......@@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
Zero
)
);
ns.internalField() = nsv.internalField()*Cw;
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
......
......@@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
volScalarField& Gtot = tGtot.ref();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
scalarField N(Nv.internalField()*Cw);
scalarField N(Nv.primitiveField()*Cw);
forAll(N, celli)
{
......
......@@ -130,7 +130,7 @@ void PDRkEpsilon::correct()
tgradU.clear();
// Update espsilon and G at the wall
epsilon_.boundaryField().updateCoeffs();
epsilon_.boundaryFieldRef().updateCoeffs();
// Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations
......@@ -163,7 +163,7 @@ void PDRkEpsilon::correct()
epsEqn.ref().relax();
epsEqn.ref().boundaryManipulate(epsilon_.boundaryField());
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
solve(epsEqn);
bound(epsilon_, epsilonMin_);
......
......@@ -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
......@@ -36,8 +36,8 @@ Description
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phiSt))().internalField()
/ rho.internalField()
fvc::surfaceSum(mag(phiSt))().primitiveField()
/ rho.primitiveField()
);
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
if (subGridSchelkin_)
{
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
......
......@@ -82,7 +82,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
{
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
......@@ -119,9 +119,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
}
}
volScalarField::Boundary& xieqBf = xieq.boundaryFieldRef();
forAll(xieq.boundaryField(), patchi)
{
scalarField& xieqp = xieq.boundaryField()[patchi];
scalarField& xieqp = xieqBf[patchi];
const scalarField& Kp = K.boundaryField()[patchi];
const scalarField& Map = Ma.boundaryField()[patchi];
const scalarField& upBySup = upBySu.boundaryField()[patchi];
......
......@@ -114,7 +114,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
)
);
volScalarField& N = tN.ref();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns
(
......@@ -134,7 +134,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
Zero
)
);
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
......@@ -150,7 +150,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
// Re use tN
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}
......
const volScalarField& psi = thermo.psi();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment