62 #include "wallFvPatch.H"
70 int main(
int argc,
char *argv[])
73 #include "postProcess.H"
75 #include "setRootCase.H"
76 #include "createTime.H"
77 #include "createMesh.H"
81 #include "createTimeControls.H"
87 scalar meanCoNum = 0.0;
89 Info<<
"\nStarting time loop\n" << endl;
119 #include "readTimeControls.H"
124 Info<<
"Time = " << runTime.timeName() << nl << endl;
133 surfaceScalarField tphi =
phiu*da1dtf*(Tau1-Tau2);
134 tphi.setOriented(
true);
137 p.correctBoundaryConditions();
143 -fvm::laplacian(Tau1/rho1,
p)
147 -fvm::laplacian(Tau2/rho2,
p)
155 pEqn.setReference(pRefCell, getRefCellValue(
p, pRefCell));
198 surfaceScalarField DeltaTauFlux =
201 DeltaTauFlux.setOriented(
true);
206 if (
thermo.cAlpha() > SMALL)
208 surfaceScalarField phic(
thermo.cAlpha()*mag(
phi/mesh.magSf()));
213 surfaceScalarField::Boundary& phicBf =
214 phic.boundaryFieldRef();
216 forAll(phic.boundaryField(), patchi)
218 fvsPatchScalarField& phicp = phicBf[patchi];
220 if (!phicp.coupled())
226 surfaceScalarField phir(phic*
thermo.nHatf());
231 -fvc::flux(-phir, alpha2,
"div(phir,alphar)"),
239 1.0 / runTime.deltaTValue(),
261 Info <<
"max/min alpha1: " << max(alpha1).value() <<
"/" << min(alpha1).value() << endl;
262 alpha1 = max(min(alpha1,1.0),0.0);
263 alpha2 = 1.0 - alpha1;
296 *(1.0 + da1dt*(Tau1-Tau2))
298 fvm::laplacian(
muf,
U)
304 cFrc*(1.0 + da1dt*(Tau1-Tau2))
316 *(1.0 + da1dt*(Tau1-Tau2))
318 fvc::laplacian(
muf,
U)
324 cFrc*(1.0 + da1dt*(Tau1-Tau2))
330 Info<<
"ExecutionTime = " << runTime.elapsedCpuTime() <<
" s"
331 <<
" ClockTime = " << runTime.elapsedClockTime() <<
" s"
336 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)
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
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)
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))
Switch implicitDiffusion(thermo.implicitDiffusion())
Creates the face-flux fields.
tmp< surfaceScalarField > div(const volVectorField &vF)
surfaceVectorField cFrcf("cFrcf",)
surfaceScalarField rhoPhi("rhoPhi", rho1 *phi)
surfaceScalarField alpha1f("alpha1f",)
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",)