62 #include "wallFvPatch.H"
67 #include "fvcSmooth.H"
71 int main(
int argc,
char *argv[])
73 argList::addOption(
"smoothAlpha");
74 argList::addOption(
"nSmoothIters");
75 argList::addOption(
"smoothCoeff");
77 #include "postProcess.H"
79 #include "setRootCase.H"
81 #include "createTime.H"
82 #include "createMesh.H"
86 #include "createTimeControls.H"
94 scalar meanCoNum = 0.0;
96 Info<<
"\nStarting time loop\n" << endl;
126 #include "readTimeControls.H"
131 Info<<
"Time = " << runTime.timeName() << nl << endl;
140 surfaceScalarField tphi =
phiu*da1dtf*(Tau1-Tau2);
141 tphi.setOriented(
true);
144 p.correctBoundaryConditions();
150 -fvm::laplacian(Tau1/rho1,
p)
154 -fvm::laplacian(Tau2/rho2,
p)
162 pEqn.setReference(pRefCell, getRefCellValue(
p, pRefCell));
176 W1 = ((
Uf &
gradUf) + (1./rho1)*
gradpf - g - linearInterpolate(cFrc)/rho1)*Tau1;
177 W2 = ((
Uf &
gradUf) + (1./rho2)*
gradpf - g - linearInterpolate(cFrc)/rho2)*Tau2;
207 surfaceScalarField DeltaTauFlux =
210 DeltaTauFlux.setOriented(
true);
215 if (
thermo.cAlpha() > SMALL)
217 surfaceScalarField phic(
thermo.cAlpha()*mag(
phi/mesh.magSf()));
222 surfaceScalarField::Boundary& phicBf =
223 phic.boundaryFieldRef();
225 forAll(phic.boundaryField(), patchi)
227 fvsPatchScalarField& phicp = phicBf[patchi];
229 if (!phicp.coupled())
235 surfaceScalarField phir(phic*
thermo.nHatf());
240 -fvc::flux(-phir, alpha2,
"div(phir,alphar)"),
248 1.0 / runTime.deltaTValue(),
270 Info <<
"max/min alpha1: " << max(alpha1).value() <<
"/" << min(alpha1).value() << endl;
271 alpha1 = max(min(alpha1,1.0),0.0);
272 alpha2 = 1.0 - alpha1;
304 fvm::laplacian(
muf,
U)
319 fvc::snGrad(
p)*mesh.magSf()
323 )*(1.0 + da1dt*(Tau1-Tau2))
335 *(1.0 + da1dt*(Tau1-Tau2))
337 fvc::laplacian(
muf,
U)
343 cFrc*(1.0 + da1dt*(Tau1-Tau2))
349 Info<<
"ExecutionTime = " << runTime.elapsedCpuTime() <<
" s"
350 <<
" ClockTime = " << runTime.elapsedClockTime() <<
" s"
355 Info<<
"End\n" << endl;
surfaceScalarField phiAlpha1f("phiAlpha1f", phi *alpha1f)
surfaceScalarField phi1("phi1", mesh.Sf()&linearInterpolate(U))
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdFlux(const GeometricField< scalar, Foam::fvsPatchField, Foam::surfaceMesh > &flux, const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi, const GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > &psif, const word fluxName)
Calculates the mean and maximum wave speed based Courant Numbers.
surfaceScalarField phiw2("phiw2", phi *alpha1f)
Creates interpolation instances templated for QGD solver.
surfaceScalarField phiw1("phiw1", phi *alpha1f)
Creates the face fields: linear interpolation of fields from volumes to face centers.
int main(int argc, char *argv[])
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
Switch implicitDiffusion(thermo.implicitDiffusion())
surfaceVectorField phiRhofWf("phiUf", phi *Uf *rho1)
surfaceScalarField phi2("phi2", mesh.Sf()&linearInterpolate(U))
surfaceVectorField phiUfRhof("phiUf", phi *Uf *rho1)
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdInterpolate(const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi)
Reset the timestep to maintain a constant maximum courant Number. Reduction of time-step is immediate...
surfaceScalarField phiwm("phiwm", phiwo1 *0.0)
surfaceVectorField gradpf("gradpf", fvsc::grad(p))
Creates the face-flux fields.
tmp< surfaceScalarField > div(const volVectorField &vF)
surfaceScalarField rhoPhi("rhoPhi", rho1 *phi)
surfaceScalarField alpha1f("alpha1f",)
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
surfaceVectorField W1("Wf", linearInterpolate(U)*0.0)
surfaceScalarField alpha2f("alpha2f", 1.0-alpha1f)
surfaceScalarField phiWr("phiWr", phiwo1 *0.0)
tmp< surfaceVectorField > grad(const volScalarField &vF)
fvScalarMatrix pEqn(fvc::div(phiu)-fvc::div(phiwo)-fvm::laplacian(taubyrhof, p))
surfaceVectorField W2("Wf", linearInterpolate(U)*0.0)
surfaceScalarField phiAlpha2f("phiAlpha2f", phi *alpha1f)
Updates fluxes for continuity equation.
surfaceScalarField coeffp("coeffp",)