Commit 7df00f96 authored by Henry's avatar Henry
Browse files

Correct line lengths

parent 3b415378
......@@ -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-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -113,19 +113,23 @@ int main(int argc, char *argv[])
solve(UEqn() == -fvc::grad(p));
p.boundaryField().updateCoeffs();
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(HbyA) & mesh.Sf()
);
adjustPhi(phiHbyA, U, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -133,7 +137,7 @@ int main(int argc, char *argv[])
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -143,7 +147,7 @@ int main(int argc, char *argv[])
p.relax();
// Momentum corrector
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
......@@ -174,19 +178,23 @@ int main(int argc, char *argv[])
solve(UaEqn() == -fvc::grad(pa));
pa.boundaryField().updateCoeffs();
volScalarField rAUa(1.0/UaEqn().A());
Ua = rAUa*UaEqn().H();
volVectorField HbyAa("HbyAa", Ua);
HbyAa = rAUa*UaEqn().H();
UaEqn.clear();
phia = fvc::interpolate(Ua) & mesh.Sf();
adjustPhi(phia, Ua, pa);
surfaceScalarField phiHbyAa
(
"phiHbyAa",
fvc::interpolate(HbyAa) & mesh.Sf()
);
adjustPhi(phiHbyAa, Ua, pa);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix paEqn
(
fvm::laplacian(rAUa, pa) == fvc::div(phia)
fvm::laplacian(rAUa, pa) == fvc::div(phiHbyAa)
);
paEqn.setReference(paRefCell, paRefValue);
......@@ -194,7 +202,7 @@ int main(int argc, char *argv[])
if (simple.finalNonOrthogonalIter())
{
phia -= paEqn.flux();
phia = phiHbyAa - paEqn.flux();
}
}
......@@ -204,7 +212,7 @@ int main(int argc, char *argv[])
pa.relax();
// Adjoint momentum corrector
Ua -= rAUa*fvc::grad(pa);
Ua = HbyAa - rAUa*fvc::grad(pa);
Ua.correctBoundaryConditions();
}
......
......@@ -68,17 +68,22 @@ int main(int argc, char *argv[])
{
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi)
);
adjustPhi(phi, U, p);
adjustPhi(phiHbyA, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -86,13 +91,13 @@ int main(int argc, char *argv[])
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
......
......@@ -71,17 +71,22 @@ int main(int argc, char *argv[])
{
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi)
);
adjustPhi(phi, U, p);
adjustPhi(phiHbyA, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -89,13 +94,13 @@ int main(int argc, char *argv[])
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
......
volScalarField rAUrel(1.0/UrelEqn().A());
Urel = rAUrel*(UrelEqn() == sources(Urel))().H();
volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*(UrelEqn() == sources(Urel))().H();
if (pimple.nCorrPISO() <= 1)
{
UrelEqn.clear();
}
phi = (fvc::interpolate(Urel) & mesh.Sf())
+ fvc::ddtPhiCorr(rAUrel, Urel, phi);
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAUrel, Urel, phi)
);
adjustPhi(phi, Urel, p);
adjustPhi(phiHbyA, Urel, p);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
......@@ -17,7 +22,7 @@ while (pimple.correctNonOrthogonal())
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::laplacian(rAUrel, p) == fvc::div(phi)
fvm::laplacian(rAUrel, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -26,7 +31,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -35,6 +40,6 @@ while (pimple.correctNonOrthogonal())
p.relax();
// Momentum corrector
Urel -= rAUrel*fvc::grad(p);
Urel = HbyA - rAUrel*fvc::grad(p);
Urel.correctBoundaryConditions();
sources.correct(Urel);
U = rAU*(UEqn() == sources(U))().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == sources(U))().H();
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
}
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi)
);
adjustPhi(phi, U, p);
adjustPhi(phiHbyA, U, p);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
......@@ -16,7 +21,7 @@ while (pimple.correctNonOrthogonal())
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -25,7 +30,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -34,6 +39,6 @@ while (pimple.correctNonOrthogonal())
// Explicitly relax pressure for momentum corrector
p.relax();
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
U = rAU*(UEqn() == sources(U))().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == sources(U))().H();
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
}
phi = (fvc::interpolate(U) & mesh.Sf());
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
);
if (ddtPhiCorr)
{
phi += fvc::ddtPhiCorr(rAU, U, phi);
phiHbyA += fvc::ddtPhiCorr(rAU, U, phi);
}
if (p.needReference())
{
fvc::makeRelative(phi, U);
adjustPhi(phi, U, p);
fvc::makeAbsolute(phi, U);
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -32,7 +37,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -44,6 +49,6 @@ p.relax();
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
......@@ -81,11 +81,16 @@ int main(int argc, char *argv[])
{
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi)
);
adjustPhi(phi, U, p);
adjustPhi(phiHbyA, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
......@@ -94,7 +99,7 @@ int main(int argc, char *argv[])
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -114,13 +119,13 @@ int main(int argc, char *argv[])
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
}
......
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rAUf(rAU.name() + 'f', fvc::interpolate(rAU));
U = rAU*(UEqn() == sources(U))().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == sources(U))().H();
if (pimple.nCorrPISO() <= 1)
{
UEqn.clear();
}
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi)
);
adjustPhi(phi, U, p_gh);
adjustPhi(phiHbyA, U, p_gh);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
{
fvScalarMatrix p_ghEqn
(
fvm::laplacian(rAUf, p_gh) == fvc::div(phi)
fvm::laplacian(rAUf, p_gh) == fvc::div(phiHbyA)
);
p_ghEqn.setReference(p_ghRefCell, p_ghRefValue);
......@@ -28,7 +33,7 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi -= p_ghEqn.flux();
phi = phiHbyA - p_ghEqn.flux();
}
}
......@@ -39,6 +44,6 @@ p_gh.relax();
p = p_gh + (g & (mesh.C() + zeta - refLevel));
U -= rAU*fvc::grad(p_gh);
U = HbyA - rAU*fvc::grad(p_gh);
U.correctBoundaryConditions();
sources.correct(U);
......@@ -97,25 +97,30 @@ int main(int argc, char *argv[])
surfaceScalarField phih0(ghrAUf*mesh.magSf()*fvc::snGrad(h0));
volVectorField HbyA("HbyA", hU);
if (rotating)
{
hU = rAU*(hUEqn.H() - (F ^ hU));
HbyA = rAU*(hUEqn.H() - (F ^ hU));
}
else
{
hU = rAU*hUEqn.H();
HbyA = rAU*hUEqn.H();
}
phi = (fvc::interpolate(hU) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, h, hU, phi)
- phih0;
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, h, hU, phi)
- phih0
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix hEqn
(
fvm::ddt(h)
+ fvc::div(phi)
+ fvc::div(phiHbyA)
- fvm::laplacian(ghrAUf, h)
);
......@@ -123,11 +128,11 @@ int main(int argc, char *argv[])
if (pimple.finalNonOrthogonalIter())
{
phi += hEqn.flux();
phi = phiHbyA + hEqn.flux();
}
}
hU -= rAU*h*magg*fvc::grad(h + h0);
hU = HbyA - rAU*h*magg*fvc::grad(h + h0);
// Constrain the momentum to be in the geometry if 3D geometry
if (mesh.nGeometricD() == 3)
......
{
p.boundaryField().updateCoeffs();
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
mrfZones.relativeFlux(phi);
adjustPhi(phi, U, p);
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
adjustPhi(phiHbyA, U, p);
mrfZones.relativeFlux(phiHbyA);
adjustPhi(phiHbyA, U, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -22,7 +22,7 @@
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -32,7 +32,7 @@
p.relax();
// Momentum corrector
U -= rAU*fvc::grad(p);
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
}
{
p.boundaryField().updateCoeffs();
volScalarField rAUrel(1.0/UrelEqn().A());
Urel = rAUrel*UrelEqn().H();
volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*UrelEqn().H();
UrelEqn.clear();
phi = fvc::interpolate(Urel, "interpolate(HbyA)") & mesh.Sf();
adjustPhi(phi, Urel, p);
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
adjustPhi(phiHbyA, Urel, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAUrel, p) == fvc::div(phi)
fvm::laplacian(rAUrel, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -22,7 +21,7 @@
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
phi = phiHbyA - pEqn.flux();
}
}
......@@ -32,7 +31,7 @@
p.relax();
// Momentum corrector
Urel -= rAUrel*fvc::grad(p);