solvers::shockFluid: New solver module for density-based solution of compressible flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations. Replaces rhoCentralFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/shockFluid.
Unlike rhoCentralFoam shockFluid supports mesh refinement/unrefinement, topology
change, run-time mesh-to-mesh mapping, load-balancing in addition to general
mesh-motion.
The tutorials/modules/shockFluid/movingCone case has been updated to demonstrate
run-time mesh-to-mesh mapping mesh topology change based on the
tutorials/modules/incompressibleFluid/movingCone. shockFluid s
Description
Solver module for density-based solution of compressible flow
Based on central-upwind schemes of Kurganov and Tadmor with support for
mesh-motion and topology change.
Reference:
\verbatim
Greenshields, C. J., Weller, H. G., Gasparini, L.,
& Reese, J. M. (2010).
Implementation of semi‐discrete, non‐staggered central schemes
in a colocated, polyhedral, finite volume framework,
for high‐speed viscous flows.
International journal for numerical methods in fluids, 63(1), 1-21.
\endverbatim
SourceFiles
shockFluid.C
See also
Foam::solvers::fluidSolver
Foam::solvers::incompressibleFluid
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
rhoCentralFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/rhoCentralFoam
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
volScalarField& p = thermo.p();
|
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
const volScalarField& mu = thermo.mu();
|
|
||||||
|
|
||||||
bool inviscid(true);
|
|
||||||
if (max(mu.primitiveField()) > 0.0)
|
|
||||||
{
|
|
||||||
inviscid = false;
|
|
||||||
}
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
#include "createRDeltaT.H"
|
|
||||||
|
|
||||||
Info<< "Reading thermophysical properties\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<psiThermo> pThermo
|
|
||||||
(
|
|
||||||
psiThermo::New(mesh)
|
|
||||||
);
|
|
||||||
psiThermo& thermo = pThermo();
|
|
||||||
|
|
||||||
volScalarField& e = thermo.he();
|
|
||||||
|
|
||||||
Info<< "Reading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.name(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.name(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
thermo.renameRho()
|
|
||||||
);
|
|
||||||
|
|
||||||
volVectorField rhoU
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rhoU",
|
|
||||||
runTime.name(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
rho*U
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField rhoE
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rhoE",
|
|
||||||
runTime.name(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
rho*(e + 0.5*magSqr(U))
|
|
||||||
);
|
|
||||||
|
|
||||||
surfaceScalarField pos
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"pos",
|
|
||||||
runTime.name(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimless, 1.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
surfaceScalarField neg
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"neg",
|
|
||||||
runTime.name(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimless, -1.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
surfaceScalarField phi("phi", fvc::flux(rhoU));
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::momentumTransportModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::momentumTransportModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating thermophysical transport model\n" << endl;
|
|
||||||
autoPtr<fluidThermoThermophysicalTransportModel> thermophysicalTransport
|
|
||||||
(
|
|
||||||
fluidThermoThermophysicalTransportModel::New(turbulence(), thermo)
|
|
||||||
);
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
//- Interpolate field vf according to direction dir
|
|
||||||
template<class Type>
|
|
||||||
tmp<SurfaceField<Type>> interpolate
|
|
||||||
(
|
|
||||||
const VolField<Type>& vf,
|
|
||||||
const surfaceScalarField& dir,
|
|
||||||
const word& reconFieldName = word::null
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<SurfaceField<Type>> tsf
|
|
||||||
(
|
|
||||||
fvc::interpolate
|
|
||||||
(
|
|
||||||
vf,
|
|
||||||
dir,
|
|
||||||
"reconstruct("
|
|
||||||
+ (reconFieldName != word::null ? reconFieldName : vf.name())
|
|
||||||
+ ')'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
SurfaceField<Type>& sf = tsf.ref();
|
|
||||||
|
|
||||||
sf.rename(vf.name() + '_' + dir.name());
|
|
||||||
|
|
||||||
return tsf;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
word fluxScheme("Kurganov");
|
|
||||||
if (mesh.schemes().dict().readIfPresent("fluxScheme", fluxScheme))
|
|
||||||
{
|
|
||||||
if ((fluxScheme == "Tadmor") || (fluxScheme == "Kurganov"))
|
|
||||||
{
|
|
||||||
Info<< "fluxScheme: " << fluxScheme << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "fluxScheme: " << fluxScheme
|
|
||||||
<< " is not a valid choice. "
|
|
||||||
<< "Options are: Tadmor, Kurganov"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,295 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
|
||||||
\\/ 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
|
|
||||||
rhoCentralFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Density-based compressible flow solver based on central-upwind schemes of
|
|
||||||
Kurganov and Tadmor with support for mesh-motion and topology changes.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "psiThermo.H"
|
|
||||||
#include "compressibleMomentumTransportModels.H"
|
|
||||||
#include "fluidThermoThermophysicalTransportModel.H"
|
|
||||||
#include "fixedRhoFvPatchScalarField.H"
|
|
||||||
#include "directionInterpolate.H"
|
|
||||||
#include "localEulerDdtScheme.H"
|
|
||||||
#include "fvcSmooth.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#define NO_CONTROL
|
|
||||||
#include "postProcess.H"
|
|
||||||
|
|
||||||
#include "setRootCaseLists.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "createFieldRefs.H"
|
|
||||||
#include "createTimeControls.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "readFluxScheme.H"
|
|
||||||
|
|
||||||
dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0);
|
|
||||||
|
|
||||||
// Courant numbers used to adjust the time-step
|
|
||||||
scalar CoNum = 0.0;
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (runTime.run())
|
|
||||||
{
|
|
||||||
#include "readTimeControls.H"
|
|
||||||
|
|
||||||
if (!LTS)
|
|
||||||
{
|
|
||||||
#include "setDeltaT.H"
|
|
||||||
|
|
||||||
// Update the mesh for topology change, mesh to mesh mapping
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
runTime++;
|
|
||||||
|
|
||||||
// Move the mesh
|
|
||||||
mesh.move();
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Directed interpolation of primitive fields onto faces
|
|
||||||
|
|
||||||
const surfaceScalarField rho_pos(interpolate(rho, pos));
|
|
||||||
const surfaceScalarField rho_neg(interpolate(rho, neg));
|
|
||||||
|
|
||||||
const surfaceVectorField rhoU_pos(interpolate(rhoU, pos, U.name()));
|
|
||||||
const surfaceVectorField rhoU_neg(interpolate(rhoU, neg, U.name()));
|
|
||||||
|
|
||||||
const surfaceVectorField U_pos("U_pos", rhoU_pos/rho_pos);
|
|
||||||
const surfaceVectorField U_neg("U_neg", rhoU_neg/rho_neg);
|
|
||||||
|
|
||||||
const volScalarField rPsi("rPsi", 1.0/psi);
|
|
||||||
const surfaceScalarField rPsi_pos(interpolate(rPsi, pos, T.name()));
|
|
||||||
const surfaceScalarField rPsi_neg(interpolate(rPsi, neg, T.name()));
|
|
||||||
|
|
||||||
const surfaceScalarField p_pos("p_pos", rho_pos*rPsi_pos);
|
|
||||||
const surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg);
|
|
||||||
|
|
||||||
surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf());
|
|
||||||
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
|
|
||||||
|
|
||||||
// Make fluxes relative to mesh-motion
|
|
||||||
if (mesh.moving())
|
|
||||||
{
|
|
||||||
phiv_pos -= mesh.phi();
|
|
||||||
phiv_neg -= mesh.phi();
|
|
||||||
}
|
|
||||||
|
|
||||||
const volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
|
||||||
const surfaceScalarField cSf_pos
|
|
||||||
(
|
|
||||||
"cSf_pos",
|
|
||||||
interpolate(c, pos, T.name())*mesh.magSf()
|
|
||||||
);
|
|
||||||
const surfaceScalarField cSf_neg
|
|
||||||
(
|
|
||||||
"cSf_neg",
|
|
||||||
interpolate(c, neg, T.name())*mesh.magSf()
|
|
||||||
);
|
|
||||||
|
|
||||||
const surfaceScalarField ap
|
|
||||||
(
|
|
||||||
"ap",
|
|
||||||
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
|
|
||||||
);
|
|
||||||
const surfaceScalarField am
|
|
||||||
(
|
|
||||||
"am",
|
|
||||||
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
|
|
||||||
);
|
|
||||||
|
|
||||||
const surfaceScalarField a_pos
|
|
||||||
(
|
|
||||||
"a_pos",
|
|
||||||
fluxScheme == "Tadmor"
|
|
||||||
? surfaceScalarField::New("a_pos", mesh, 0.5)
|
|
||||||
: ap/(ap - am)
|
|
||||||
);
|
|
||||||
|
|
||||||
const surfaceScalarField a_neg("a_neg", 1.0 - a_pos);
|
|
||||||
|
|
||||||
phiv_pos *= a_pos;
|
|
||||||
phiv_neg *= a_neg;
|
|
||||||
|
|
||||||
const surfaceScalarField aSf
|
|
||||||
(
|
|
||||||
"aSf",
|
|
||||||
fluxScheme == "Tadmor"
|
|
||||||
? -0.5*max(mag(am), mag(ap))
|
|
||||||
: am*a_pos
|
|
||||||
);
|
|
||||||
|
|
||||||
const surfaceScalarField aphiv_pos("aphiv_pos", phiv_pos - aSf);
|
|
||||||
const surfaceScalarField aphiv_neg("aphiv_neg", phiv_neg + aSf);
|
|
||||||
|
|
||||||
{
|
|
||||||
const surfaceScalarField amaxSf
|
|
||||||
(
|
|
||||||
max(mag(aphiv_pos), mag(aphiv_neg))
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "centralCourantNo.H"
|
|
||||||
|
|
||||||
if (LTS)
|
|
||||||
{
|
|
||||||
#include "setRDeltaT.H"
|
|
||||||
runTime++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
|
||||||
|
|
||||||
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
|
||||||
|
|
||||||
// --- Solve density
|
|
||||||
solve(fvm::ddt(rho) + fvc::div(phi));
|
|
||||||
|
|
||||||
turbulence->predict();
|
|
||||||
thermophysicalTransport->predict();
|
|
||||||
|
|
||||||
const volScalarField muEff("muEff", rho*turbulence->nuEff());
|
|
||||||
const volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
|
|
||||||
|
|
||||||
// --- Solve momentum
|
|
||||||
{
|
|
||||||
const surfaceVectorField phiUp
|
|
||||||
(
|
|
||||||
(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg)
|
|
||||||
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf()
|
|
||||||
);
|
|
||||||
|
|
||||||
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
|
|
||||||
|
|
||||||
U.ref() =
|
|
||||||
rhoU()
|
|
||||||
/rho();
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
|
|
||||||
|
|
||||||
if (!inviscid)
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, U) - fvc::ddt(rho, U)
|
|
||||||
- fvm::laplacian(muEff, U)
|
|
||||||
- fvc::div(tauMC)
|
|
||||||
);
|
|
||||||
rhoU = rho*U;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Solve energy
|
|
||||||
{
|
|
||||||
const surfaceScalarField e_pos(interpolate(e, pos, T.name()));
|
|
||||||
const surfaceScalarField e_neg(interpolate(e, neg, T.name()));
|
|
||||||
|
|
||||||
surfaceScalarField phiEp
|
|
||||||
(
|
|
||||||
"phiEp",
|
|
||||||
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
|
|
||||||
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
|
|
||||||
+ aSf*p_pos - aSf*p_neg
|
|
||||||
);
|
|
||||||
|
|
||||||
// Make flux for pressure-work absolute
|
|
||||||
if (mesh.moving())
|
|
||||||
{
|
|
||||||
phiEp += mesh.phi()*(a_pos*p_pos + a_neg*p_neg);
|
|
||||||
}
|
|
||||||
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
fvm::ddt(rhoE)
|
|
||||||
+ fvc::div(phiEp)
|
|
||||||
);
|
|
||||||
|
|
||||||
e = rhoE/rho - 0.5*magSqr(U);
|
|
||||||
e.correctBoundaryConditions();
|
|
||||||
thermo.correct();
|
|
||||||
rhoE.boundaryFieldRef() ==
|
|
||||||
rho.boundaryField()*
|
|
||||||
(
|
|
||||||
e.boundaryField() + 0.5*magSqr(U.boundaryField())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!inviscid)
|
|
||||||
{
|
|
||||||
const surfaceScalarField sigmaDotU
|
|
||||||
(
|
|
||||||
"sigmaDotU",
|
|
||||||
(
|
|
||||||
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
|
||||||
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
|
||||||
)
|
|
||||||
& (a_pos*U_pos + a_neg*U_neg)
|
|
||||||
);
|
|
||||||
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, e) - fvc::ddt(rho, e)
|
|
||||||
+ thermophysicalTransport->divq(e)
|
|
||||||
- fvc::div(sigmaDotU)
|
|
||||||
);
|
|
||||||
thermo.correct();
|
|
||||||
rhoE = rho*(e + 0.5*magSqr(U));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
p.ref() = rho()/psi();
|
|
||||||
p.correctBoundaryConditions();
|
|
||||||
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
|
||||||
thermophysicalTransport->correct();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
volScalarField& rDeltaT = trDeltaT.ref();
|
|
||||||
|
|
||||||
scalar rDeltaTSmoothingCoeff
|
|
||||||
(
|
|
||||||
runTime.controlDict().lookupOrDefault<scalar>
|
|
||||||
(
|
|
||||||
"rDeltaTSmoothingCoeff",
|
|
||||||
0.02
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the reciprocal time-step from the local Courant number
|
|
||||||
rDeltaT.ref() = max
|
|
||||||
(
|
|
||||||
1/dimensionedScalar(dimTime, maxDeltaT),
|
|
||||||
fvc::surfaceSum(amaxSf)()()
|
|
||||||
/((2*maxCo)*mesh.V())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update the boundary values of the reciprocal time-step
|
|
||||||
rDeltaT.correctBoundaryConditions();
|
|
||||||
|
|
||||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
|
||||||
|
|
||||||
Info<< "Flow time scale min/max = "
|
|
||||||
<< gMin(1/rDeltaT.primitiveField())
|
|
||||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
|
||||||
}
|
|
||||||
16
applications/solvers/modules/shockFluid/Make/files
Normal file
16
applications/solvers/modules/shockFluid/Make/files
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
setRDeltaT.C
|
||||||
|
moveMesh.C
|
||||||
|
prePredictor.C
|
||||||
|
fluxPredictor.C
|
||||||
|
correctDensity.C
|
||||||
|
momentumPredictor.C
|
||||||
|
thermophysicalPredictor.C
|
||||||
|
pressureCorrector.C
|
||||||
|
shockFluid.C
|
||||||
|
|
||||||
|
derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C
|
||||||
|
derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C
|
||||||
|
derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C
|
||||||
|
derivedFvPatchFields/rho/fixedRhoFvPatchScalarField.C
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libshockFluid
|
||||||
@ -1,24 +1,23 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-IBCs/lnInclude \
|
-I$(FOAM_SOLVERS)/modules/fluidSolver/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
||||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \
|
-I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \
|
||||||
-I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
|
-I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
|
||||||
-I$(LIB_SRC)/ThermophysicalTransportModels/fluidThermo/lnInclude \
|
-I$(LIB_SRC)/ThermophysicalTransportModels/fluidThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
LIB_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfluidSolver \
|
||||||
-lfvModels \
|
|
||||||
-lfvConstraints \
|
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
|
||||||
-lrhoCentralFoam \
|
|
||||||
-lmomentumTransportModels \
|
-lmomentumTransportModels \
|
||||||
-lcompressibleMomentumTransportModels \
|
-lcompressibleMomentumTransportModels \
|
||||||
-lcoupledThermophysicalTransportModels \
|
-lcoupledThermophysicalTransportModels \
|
||||||
-lmeshTools
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
|
-lfvModels \
|
||||||
|
-lfvConstraints
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -21,24 +21,27 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Global
|
|
||||||
centralCourantNo
|
|
||||||
|
|
||||||
Description
|
|
||||||
Calculates the mean and maximum wave speed based Courant Numbers.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::correctDensity()
|
||||||
{
|
{
|
||||||
const scalarField sumAmaxSf(fvc::surfaceSum(amaxSf)().primitiveField());
|
fvScalarMatrix rhoEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho) + fvc::div(phi)
|
||||||
|
==
|
||||||
|
fvModels().source(rho)
|
||||||
|
);
|
||||||
|
|
||||||
CoNum = 0.5*gMax(sumAmaxSf/mesh.V().field())*runTime.deltaTValue();
|
fvConstraints().constrain(rhoEqn);
|
||||||
|
|
||||||
scalar meanCoNum =
|
rhoEqn.solve();
|
||||||
0.5*(gSum(sumAmaxSf)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
|
||||||
|
|
||||||
Info<< "Mean and max Courant Numbers = "
|
fvConstraints().constrain(rho);
|
||||||
<< meanCoNum << " " << CoNum << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
130
applications/solvers/modules/shockFluid/fluxPredictor.C
Normal file
130
applications/solvers/modules/shockFluid/fluxPredictor.C
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::fluxPredictor()
|
||||||
|
{
|
||||||
|
if (!pos.valid())
|
||||||
|
{
|
||||||
|
pos = surfaceScalarField::New
|
||||||
|
(
|
||||||
|
"pos",
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(dimless, 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
neg = surfaceScalarField::New
|
||||||
|
(
|
||||||
|
"neg",
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(dimless, -1.0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
rho_pos = interpolate(rho, pos());
|
||||||
|
rho_neg = interpolate(rho, neg());
|
||||||
|
|
||||||
|
rhoU_pos = interpolate(rhoU, pos(), U.name());
|
||||||
|
rhoU_neg = interpolate(rhoU, neg(), U.name());
|
||||||
|
|
||||||
|
U_pos = surfaceVectorField::New("U_pos", rhoU_pos()/rho_pos());
|
||||||
|
U_neg = surfaceVectorField::New("U_neg", rhoU_neg()/rho_neg());
|
||||||
|
|
||||||
|
const volScalarField& T = thermo.T();
|
||||||
|
|
||||||
|
const volScalarField rPsi("rPsi", 1.0/thermo.psi());
|
||||||
|
const surfaceScalarField rPsi_pos(interpolate(rPsi, pos(), T.name()));
|
||||||
|
const surfaceScalarField rPsi_neg(interpolate(rPsi, neg(), T.name()));
|
||||||
|
|
||||||
|
p_pos = surfaceScalarField::New("p_pos", rho_pos()*rPsi_pos);
|
||||||
|
p_neg = surfaceScalarField::New("p_neg", rho_neg()*rPsi_neg);
|
||||||
|
|
||||||
|
surfaceScalarField phiv_pos("phiv_pos", U_pos() & mesh.Sf());
|
||||||
|
surfaceScalarField phiv_neg("phiv_neg", U_neg() & mesh.Sf());
|
||||||
|
|
||||||
|
// Make fluxes relative to mesh-motion
|
||||||
|
if (mesh.moving())
|
||||||
|
{
|
||||||
|
phiv_pos -= mesh.phi();
|
||||||
|
phiv_neg -= mesh.phi();
|
||||||
|
}
|
||||||
|
|
||||||
|
const volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
||||||
|
const surfaceScalarField cSf_pos
|
||||||
|
(
|
||||||
|
"cSf_pos",
|
||||||
|
interpolate(c, pos(), T.name())*mesh.magSf()
|
||||||
|
);
|
||||||
|
const surfaceScalarField cSf_neg
|
||||||
|
(
|
||||||
|
"cSf_neg",
|
||||||
|
interpolate(c, neg(), T.name())*mesh.magSf()
|
||||||
|
);
|
||||||
|
|
||||||
|
const dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0);
|
||||||
|
|
||||||
|
const surfaceScalarField ap
|
||||||
|
(
|
||||||
|
"ap",
|
||||||
|
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
|
||||||
|
);
|
||||||
|
const surfaceScalarField am
|
||||||
|
(
|
||||||
|
"am",
|
||||||
|
min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
a_pos = surfaceScalarField::New
|
||||||
|
(
|
||||||
|
"a_pos",
|
||||||
|
fluxScheme == "Tadmor"
|
||||||
|
? surfaceScalarField::New("a_pos", mesh, 0.5)
|
||||||
|
: ap/(ap - am)
|
||||||
|
);
|
||||||
|
|
||||||
|
a_neg = surfaceScalarField::New("a_neg", 1.0 - a_pos());
|
||||||
|
|
||||||
|
phiv_pos *= a_pos();
|
||||||
|
phiv_neg *= a_neg();
|
||||||
|
|
||||||
|
aSf = surfaceScalarField::New
|
||||||
|
(
|
||||||
|
"aSf",
|
||||||
|
fluxScheme == "Tadmor"
|
||||||
|
? -0.5*max(mag(am), mag(ap))
|
||||||
|
: am*a_pos()
|
||||||
|
);
|
||||||
|
|
||||||
|
aphiv_pos = surfaceScalarField::New("aphiv_pos", phiv_pos - aSf());
|
||||||
|
aphiv_neg = surfaceScalarField::New("aphiv_neg", phiv_neg + aSf());
|
||||||
|
|
||||||
|
phi = aphiv_pos()*rho_pos() + aphiv_neg()*rho_neg();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
81
applications/solvers/modules/shockFluid/momentumPredictor.C
Normal file
81
applications/solvers/modules/shockFluid/momentumPredictor.C
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
#include "fvmDdt.H"
|
||||||
|
#include "fvmDiv.H"
|
||||||
|
#include "fvcDdt.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::momentumPredictor()
|
||||||
|
{
|
||||||
|
if (!inviscid)
|
||||||
|
{
|
||||||
|
muEff.clear();
|
||||||
|
tauMC.clear();
|
||||||
|
|
||||||
|
muEff = volScalarField::New("muEff", rho*momentumTransport->nuEff());
|
||||||
|
tauMC = new volTensorField
|
||||||
|
(
|
||||||
|
"tauMC",
|
||||||
|
muEff()*dev2(Foam::T(fvc::grad(U)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const surfaceVectorField phiUp
|
||||||
|
(
|
||||||
|
(aphiv_pos()*rhoU_pos() + aphiv_neg()*rhoU_neg())
|
||||||
|
+ (a_pos()*p_pos() + a_neg()*p_neg())*mesh.Sf()
|
||||||
|
);
|
||||||
|
|
||||||
|
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
|
||||||
|
|
||||||
|
U.ref() = rhoU()/rho();
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
|
if (!inviscid)
|
||||||
|
{
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, U) - fvc::ddt(rho, U)
|
||||||
|
- fvm::laplacian(muEff(), U)
|
||||||
|
- fvc::div(tauMC())
|
||||||
|
==
|
||||||
|
fvModels().source(rho, U)
|
||||||
|
);
|
||||||
|
|
||||||
|
rhoU == rho*U;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
|
||||||
|
}
|
||||||
|
|
||||||
|
fvConstraints().constrain(U);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -21,30 +21,33 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Global
|
|
||||||
setDeltaT
|
|
||||||
|
|
||||||
Description
|
|
||||||
Reset the timestep to maintain a constant maximum courant Number.
|
|
||||||
Reduction of time-step is immediate, but increase is damped to avoid
|
|
||||||
unstable oscillations.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (adjustTimeStep)
|
#include "shockFluid.H"
|
||||||
{
|
|
||||||
scalar deltaT = 1.2*runTime.deltaTValue();
|
|
||||||
|
|
||||||
if (CoNum > small)
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::solvers::shockFluid::moveMesh()
|
||||||
|
{
|
||||||
|
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||||
{
|
{
|
||||||
deltaT = min(deltaT, maxCo/CoNum*runTime.deltaTValue());
|
// Move the mesh
|
||||||
|
mesh.move();
|
||||||
|
|
||||||
|
if (mesh.changing())
|
||||||
|
{
|
||||||
|
if (mesh.topoChanged())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
meshCourantNo();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deltaT = min(deltaT, maxDeltaT);
|
return false;
|
||||||
|
|
||||||
runTime.setDeltaT(deltaT);
|
|
||||||
|
|
||||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
46
applications/solvers/modules/shockFluid/prePredictor.C
Normal file
46
applications/solvers/modules/shockFluid/prePredictor.C
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::prePredictor()
|
||||||
|
{
|
||||||
|
fluxPredictor();
|
||||||
|
|
||||||
|
correctDensity();
|
||||||
|
|
||||||
|
fvModels().correct();
|
||||||
|
|
||||||
|
if (!inviscid && pimple.predictTransport())
|
||||||
|
{
|
||||||
|
momentumTransport->predict();
|
||||||
|
thermophysicalTransport->predict();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
39
applications/solvers/modules/shockFluid/pressureCorrector.C
Normal file
39
applications/solvers/modules/shockFluid/pressureCorrector.C
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::pressureCorrector()
|
||||||
|
{
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
p.ref() = rho()/psi();
|
||||||
|
p.correctBoundaryConditions();
|
||||||
|
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
75
applications/solvers/modules/shockFluid/setRDeltaT.C
Normal file
75
applications/solvers/modules/shockFluid/setRDeltaT.C
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
#include "fvcSmooth.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::setRDeltaT(const surfaceScalarField& amaxSf)
|
||||||
|
{
|
||||||
|
volScalarField& rDeltaT = trDeltaT.ref();
|
||||||
|
|
||||||
|
const dictionary& pimpleDict = pimple.dict();
|
||||||
|
|
||||||
|
const scalar maxCo
|
||||||
|
(
|
||||||
|
pimpleDict.lookupOrDefault<scalar>("maxCo", 0.8)
|
||||||
|
);
|
||||||
|
|
||||||
|
const scalar rDeltaTSmoothingCoeff
|
||||||
|
(
|
||||||
|
pimpleDict.lookupOrDefault<scalar>
|
||||||
|
(
|
||||||
|
"rDeltaTSmoothingCoeff",
|
||||||
|
0.02
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const scalar maxDeltaT
|
||||||
|
(
|
||||||
|
pimpleDict.lookupOrDefault<scalar>("maxDeltaT", great)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Set the reciprocal time-step from the local Courant number
|
||||||
|
rDeltaT.ref() = max
|
||||||
|
(
|
||||||
|
1/dimensionedScalar(dimTime, maxDeltaT),
|
||||||
|
fvc::surfaceSum(amaxSf)()()
|
||||||
|
/((2*maxCo)*mesh.V())
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update the boundary values of the reciprocal time-step
|
||||||
|
rDeltaT.correctBoundaryConditions();
|
||||||
|
|
||||||
|
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
||||||
|
|
||||||
|
Info<< "Flow time scale min/max = "
|
||||||
|
<< gMin(1/rDeltaT.primitiveField())
|
||||||
|
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
309
applications/solvers/modules/shockFluid/shockFluid.C
Normal file
309
applications/solvers/modules/shockFluid/shockFluid.C
Normal file
@ -0,0 +1,309 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
#include "localEulerDdtScheme.H"
|
||||||
|
#include "hydrostaticInitialisation.H"
|
||||||
|
#include "fvcMeshPhi.H"
|
||||||
|
#include "fvcVolumeIntegrate.H"
|
||||||
|
#include "fvcReconstruct.H"
|
||||||
|
#include "fvcSnGrad.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace solvers
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(shockFluid, 0);
|
||||||
|
addToRunTimeSelectionTable(solver, shockFluid, fvMesh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::correctCoNum(const surfaceScalarField& amaxSf)
|
||||||
|
{
|
||||||
|
const scalarField sumAmaxSf(fvc::surfaceSum(amaxSf)().primitiveField());
|
||||||
|
|
||||||
|
CoNum = 0.5*gMax(sumAmaxSf/mesh.V().field())*runTime.deltaTValue();
|
||||||
|
|
||||||
|
const scalar meanCoNum =
|
||||||
|
0.5*(gSum(sumAmaxSf)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||||
|
|
||||||
|
Info<< "Courant Number mean: " << meanCoNum
|
||||||
|
<< " max: " << CoNum << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::clearTemporaryFields()
|
||||||
|
{
|
||||||
|
rho_pos.clear();
|
||||||
|
rho_neg.clear();
|
||||||
|
|
||||||
|
rhoU_pos.clear();
|
||||||
|
rhoU_neg.clear();
|
||||||
|
|
||||||
|
U_pos.clear();
|
||||||
|
U_neg.clear();
|
||||||
|
|
||||||
|
p_pos.clear();
|
||||||
|
p_neg.clear();
|
||||||
|
|
||||||
|
a_pos.clear();
|
||||||
|
a_neg.clear();
|
||||||
|
|
||||||
|
aSf.clear();
|
||||||
|
|
||||||
|
aphiv_pos.clear();
|
||||||
|
aphiv_neg.clear();
|
||||||
|
|
||||||
|
muEff.clear();
|
||||||
|
tauMC.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::solvers::shockFluid::shockFluid(fvMesh& mesh)
|
||||||
|
:
|
||||||
|
fluidSolver(mesh),
|
||||||
|
|
||||||
|
thermo_(psiThermo::New(mesh)),
|
||||||
|
|
||||||
|
thermo(thermo_()),
|
||||||
|
|
||||||
|
p(thermo.p()),
|
||||||
|
|
||||||
|
rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo.renameRho()
|
||||||
|
),
|
||||||
|
|
||||||
|
U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
|
||||||
|
rhoU
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rhoU",
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
rho*U
|
||||||
|
),
|
||||||
|
|
||||||
|
rhoE
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rhoE",
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
rho*(thermo.he() + 0.5*magSqr(U))
|
||||||
|
),
|
||||||
|
|
||||||
|
phi
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
linearInterpolate(rho*U) & mesh.Sf()
|
||||||
|
),
|
||||||
|
|
||||||
|
inviscid
|
||||||
|
(
|
||||||
|
max(thermo.mu()().primitiveField()) > 0
|
||||||
|
? false
|
||||||
|
: true
|
||||||
|
),
|
||||||
|
|
||||||
|
momentumTransport
|
||||||
|
(
|
||||||
|
inviscid
|
||||||
|
? autoPtr<compressibleMomentumTransportModel>(nullptr)
|
||||||
|
: compressible::momentumTransportModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
thermophysicalTransport
|
||||||
|
(
|
||||||
|
inviscid
|
||||||
|
? autoPtr<fluidThermoThermophysicalTransportModel>(nullptr)
|
||||||
|
: fluidThermoThermophysicalTransportModel::New
|
||||||
|
(
|
||||||
|
momentumTransport(),
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
fluxScheme
|
||||||
|
(
|
||||||
|
mesh.schemes().dict().lookupOrDefault<word>("fluxScheme", "Kurganov")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Read the controls
|
||||||
|
read();
|
||||||
|
|
||||||
|
thermo.validate(type(), "e");
|
||||||
|
|
||||||
|
if (momentumTransport.valid())
|
||||||
|
{
|
||||||
|
momentumTransport->validate();
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxPredictor();
|
||||||
|
|
||||||
|
if (transient())
|
||||||
|
{
|
||||||
|
const surfaceScalarField amaxSf
|
||||||
|
(
|
||||||
|
max(mag(aphiv_pos()), mag(aphiv_neg()))
|
||||||
|
);
|
||||||
|
|
||||||
|
correctCoNum(amaxSf);
|
||||||
|
}
|
||||||
|
else if (LTS)
|
||||||
|
{
|
||||||
|
Info<< "Using LTS" << endl;
|
||||||
|
|
||||||
|
trDeltaT = tmp<volScalarField>
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
fv::localEulerDdt::rDeltaTName,
|
||||||
|
runTime.name(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(dimless/dimTime, 1),
|
||||||
|
extrapolatedCalculatedFvPatchScalarField::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::solvers::shockFluid::~shockFluid()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::preSolve()
|
||||||
|
{
|
||||||
|
// Read the controls
|
||||||
|
read();
|
||||||
|
|
||||||
|
{
|
||||||
|
const surfaceScalarField amaxSf
|
||||||
|
(
|
||||||
|
max(mag(aphiv_pos()), mag(aphiv_neg()))
|
||||||
|
);
|
||||||
|
|
||||||
|
if (transient())
|
||||||
|
{
|
||||||
|
correctCoNum(amaxSf);
|
||||||
|
}
|
||||||
|
else if (LTS)
|
||||||
|
{
|
||||||
|
setRDeltaT(amaxSf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fvModels().preUpdateMesh();
|
||||||
|
|
||||||
|
if (mesh.topoChanging())
|
||||||
|
{
|
||||||
|
pos.clear();
|
||||||
|
neg.clear();
|
||||||
|
|
||||||
|
clearTemporaryFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the mesh for topology change, mesh to mesh mapping
|
||||||
|
mesh.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::postCorrector()
|
||||||
|
{
|
||||||
|
if (!inviscid && pimple.correctTransport())
|
||||||
|
{
|
||||||
|
momentumTransport->correct();
|
||||||
|
thermophysicalTransport->correct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::postSolve()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
269
applications/solvers/modules/shockFluid/shockFluid.H
Normal file
269
applications/solvers/modules/shockFluid/shockFluid.H
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::solvers::shockFluid
|
||||||
|
|
||||||
|
Description
|
||||||
|
Solver module for density-based solution of compressible flow
|
||||||
|
|
||||||
|
Based on central-upwind schemes of Kurganov and Tadmor with support for
|
||||||
|
mesh-motion and topology change.
|
||||||
|
|
||||||
|
Reference:
|
||||||
|
\verbatim
|
||||||
|
Greenshields, C. J., Weller, H. G., Gasparini, L.,
|
||||||
|
& Reese, J. M. (2010).
|
||||||
|
Implementation of semi‐discrete, non‐staggered central schemes
|
||||||
|
in a colocated, polyhedral, finite volume framework,
|
||||||
|
for high‐speed viscous flows.
|
||||||
|
International journal for numerical methods in fluids, 63(1), 1-21.
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
shockFluid.C
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::solvers::fluidSolver
|
||||||
|
Foam::solvers::incompressibleFluid
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef shockFluid_H
|
||||||
|
#define shockFluid_H
|
||||||
|
|
||||||
|
#include "fluidSolver.H"
|
||||||
|
#include "psiThermo.H"
|
||||||
|
#include "compressibleMomentumTransportModels.H"
|
||||||
|
#include "fluidThermoThermophysicalTransportModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace solvers
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class shockFluid Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class shockFluid
|
||||||
|
:
|
||||||
|
public fluidSolver
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Thermophysical properties
|
||||||
|
|
||||||
|
//- Pointer to the fluid thermophysical properties
|
||||||
|
autoPtr<psiThermo> thermo_;
|
||||||
|
|
||||||
|
//- Reference to the fluid thermophysical properties
|
||||||
|
psiThermo& thermo;
|
||||||
|
|
||||||
|
//- Reference to the pressure field
|
||||||
|
volScalarField& p;
|
||||||
|
|
||||||
|
//- The continuity density field
|
||||||
|
volScalarField rho;
|
||||||
|
|
||||||
|
//- Velocity field
|
||||||
|
volVectorField U;
|
||||||
|
|
||||||
|
//- The momentum field
|
||||||
|
volVectorField rhoU;
|
||||||
|
|
||||||
|
//- The energy field
|
||||||
|
volScalarField rhoE;
|
||||||
|
|
||||||
|
|
||||||
|
// Kinematic properties
|
||||||
|
|
||||||
|
//- Mass-flux field
|
||||||
|
surfaceScalarField phi;
|
||||||
|
|
||||||
|
|
||||||
|
// Momentum transport
|
||||||
|
|
||||||
|
bool inviscid;
|
||||||
|
|
||||||
|
//- Pointer to the momentum transport model
|
||||||
|
autoPtr<compressible::momentumTransportModel> momentumTransport;
|
||||||
|
|
||||||
|
|
||||||
|
// Thermophysical transport
|
||||||
|
|
||||||
|
autoPtr<fluidThermoThermophysicalTransportModel>
|
||||||
|
thermophysicalTransport;
|
||||||
|
|
||||||
|
|
||||||
|
// Controls
|
||||||
|
|
||||||
|
word fluxScheme;
|
||||||
|
|
||||||
|
|
||||||
|
// Cached temporary fields
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> pos;
|
||||||
|
tmp<surfaceScalarField> neg;
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> rho_pos;
|
||||||
|
tmp<surfaceScalarField> rho_neg;
|
||||||
|
|
||||||
|
tmp<surfaceVectorField> rhoU_pos;
|
||||||
|
tmp<surfaceVectorField> rhoU_neg;
|
||||||
|
|
||||||
|
tmp<surfaceVectorField> U_pos;
|
||||||
|
tmp<surfaceVectorField> U_neg;
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> p_pos;
|
||||||
|
tmp<surfaceScalarField> p_neg;
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> a_pos;
|
||||||
|
tmp<surfaceScalarField> a_neg;
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> aSf;
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> aphiv_pos;
|
||||||
|
tmp<surfaceScalarField> aphiv_neg;
|
||||||
|
|
||||||
|
tmp<volScalarField> muEff;
|
||||||
|
tmp<volTensorField> tauMC;
|
||||||
|
|
||||||
|
//- Optional LTS reciprocal time-step field
|
||||||
|
tmp<volScalarField> trDeltaT;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Set rDeltaT for LTS
|
||||||
|
void setRDeltaT(const surfaceScalarField& amaxSf);
|
||||||
|
|
||||||
|
//- Correct the cached Courant numbers
|
||||||
|
void correctCoNum(const surfaceScalarField& amaxSf);
|
||||||
|
|
||||||
|
//- Construct the continuity equation and correct the density
|
||||||
|
void correctDensity();
|
||||||
|
|
||||||
|
//- Interpolate field vf according to direction dir
|
||||||
|
template<class Type>
|
||||||
|
inline tmp<SurfaceField<Type>> interpolate
|
||||||
|
(
|
||||||
|
const VolField<Type>& vf,
|
||||||
|
const surfaceScalarField& dir,
|
||||||
|
const word& reconFieldName = word::null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<SurfaceField<Type>> tsf
|
||||||
|
(
|
||||||
|
fvc::interpolate
|
||||||
|
(
|
||||||
|
vf,
|
||||||
|
dir,
|
||||||
|
"reconstruct("
|
||||||
|
+ (reconFieldName != word::null ? reconFieldName : vf.name())
|
||||||
|
+ ')'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
SurfaceField<Type>& sf = tsf.ref();
|
||||||
|
|
||||||
|
sf.rename(vf.name() + '_' + dir.name());
|
||||||
|
|
||||||
|
return tsf;
|
||||||
|
}
|
||||||
|
|
||||||
|
void fluxPredictor();
|
||||||
|
|
||||||
|
void clearTemporaryFields();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("shockFluid");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from region mesh
|
||||||
|
shockFluid(fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construction
|
||||||
|
shockFluid(const shockFluid&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~shockFluid();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Called at the start of the time-step, before the PIMPLE loop
|
||||||
|
virtual void preSolve();
|
||||||
|
|
||||||
|
//- Called at the start of the PIMPLE loop to move the mesh
|
||||||
|
virtual bool moveMesh();
|
||||||
|
|
||||||
|
//- Called at the start of the PIMPLE loop
|
||||||
|
virtual void prePredictor();
|
||||||
|
|
||||||
|
//- Construct and optionally solve the momentum equation
|
||||||
|
virtual void momentumPredictor();
|
||||||
|
|
||||||
|
//- Construct and solve the energy equation,
|
||||||
|
// convert to temperature
|
||||||
|
// and update thermophysical and transport properties
|
||||||
|
virtual void thermophysicalPredictor();
|
||||||
|
|
||||||
|
//- Construct and solve the pressure equation in the PISO loop
|
||||||
|
virtual void pressureCorrector();
|
||||||
|
|
||||||
|
//- Correct the momentum and thermophysical transport modelling
|
||||||
|
virtual void postCorrector();
|
||||||
|
|
||||||
|
//- Called after the PIMPLE loop at the end of the time-step
|
||||||
|
virtual void postSolve();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const shockFluid&) = delete;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace solvers
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "shockFluid.H"
|
||||||
|
#include "fvcDdt.H"
|
||||||
|
#include "fvmDiv.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solvers::shockFluid::thermophysicalPredictor()
|
||||||
|
{
|
||||||
|
volScalarField& e = thermo.he();
|
||||||
|
|
||||||
|
const surfaceScalarField e_pos(interpolate(e, pos, thermo.T().name()));
|
||||||
|
const surfaceScalarField e_neg(interpolate(e, neg, thermo.T().name()));
|
||||||
|
|
||||||
|
surfaceScalarField phiEp
|
||||||
|
(
|
||||||
|
"phiEp",
|
||||||
|
aphiv_pos()*(rho_pos()*(e_pos + 0.5*magSqr(U_pos())) + p_pos())
|
||||||
|
+ aphiv_neg()*(rho_neg()*(e_neg + 0.5*magSqr(U_neg())) + p_neg())
|
||||||
|
+ aSf()*(p_pos() - p_neg())
|
||||||
|
);
|
||||||
|
|
||||||
|
// Make flux for pressure-work absolute
|
||||||
|
if (mesh.moving())
|
||||||
|
{
|
||||||
|
phiEp += mesh.phi()*(a_pos()*p_pos() + a_neg()*p_neg());
|
||||||
|
}
|
||||||
|
|
||||||
|
solve(fvm::ddt(rhoE) + fvc::div(phiEp));
|
||||||
|
|
||||||
|
e = rhoE/rho - 0.5*magSqr(U);
|
||||||
|
e.correctBoundaryConditions();
|
||||||
|
thermo.correct();
|
||||||
|
rhoE.boundaryFieldRef() ==
|
||||||
|
rho.boundaryField()*
|
||||||
|
(
|
||||||
|
e.boundaryField() + 0.5*magSqr(U.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!inviscid)
|
||||||
|
{
|
||||||
|
const surfaceScalarField sigmaDotU
|
||||||
|
(
|
||||||
|
"sigmaDotU",
|
||||||
|
(
|
||||||
|
fvc::interpolate(muEff())*mesh.magSf()*fvc::snGrad(U)
|
||||||
|
+ fvc::dotInterpolate(mesh.Sf(), tauMC())
|
||||||
|
)
|
||||||
|
& (a_pos()*U_pos() + a_neg()*U_neg())
|
||||||
|
);
|
||||||
|
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, e) - fvc::ddt(rho, e)
|
||||||
|
+ thermophysicalTransport->divq(e)
|
||||||
|
- fvc::div(sigmaDotU)
|
||||||
|
==
|
||||||
|
fvModels().source(rho, e)
|
||||||
|
);
|
||||||
|
|
||||||
|
fvConstraints().constrain(e);
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
rhoE = rho*(e + 0.5*magSqr(U));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
46
bin/rhoCentralFoam
Executable file
46
bin/rhoCentralFoam
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration | Website: https://openfoam.org
|
||||||
|
# \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
# \\/ 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/>.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# rhoCentralFoam
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Script to inform the user that rhoCentralFoam has been superseded
|
||||||
|
# and replaced by the more general shockFluid solver module
|
||||||
|
# executed by the foamRun application.
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
rhoCentralFoam has been superseded and replaced by the more general
|
||||||
|
shockFluid solver module executed by the foamRun application:
|
||||||
|
|
||||||
|
foamRun -solver shockFluid
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
exec env foamRun -solver shockFluid "$@"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -2732,31 +2732,6 @@ _renumberMesh_ ()
|
|||||||
}
|
}
|
||||||
complete -o filenames -o nospace -F _renumberMesh_ renumberMesh
|
complete -o filenames -o nospace -F _renumberMesh_ renumberMesh
|
||||||
|
|
||||||
_rhoCentralFoam_ ()
|
|
||||||
{
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
||||||
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
||||||
local line=${COMP_LINE}
|
|
||||||
local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")
|
|
||||||
|
|
||||||
opts="-case -doc -fileHandler -help -hostRoots -libs -listFunctionObjects -listMomentumTransportModels -listScalarBCs -listSwitches -listThermophysicalTransportModels -listVectorBCs -noFunctionObjects -parallel -postProcess -roots -srcDoc"
|
|
||||||
for o in $used ; do opts="${opts/$o/}" ; done
|
|
||||||
extra=""
|
|
||||||
|
|
||||||
[ "$COMP_CWORD" = 1 ] || \
|
|
||||||
case "$prev" in
|
|
||||||
-case)
|
|
||||||
opts="" ; extra="-d" ;;
|
|
||||||
-fileHandler)
|
|
||||||
opts="uncollated collated masterUncollated" ; extra="" ;;
|
|
||||||
-hostRoots|-libs|-roots)
|
|
||||||
opts="" ; extra="" ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) )
|
|
||||||
}
|
|
||||||
complete -o filenames -o nospace -F _rhoCentralFoam_ rhoCentralFoam
|
|
||||||
|
|
||||||
_rhoParticleFoam_ ()
|
_rhoParticleFoam_ ()
|
||||||
{
|
{
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
wclean libso BCs
|
# Source tutorial clean functions
|
||||||
wclean
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cleanCase
|
||||||
|
|
||||||
|
rm -rf *.eps
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@ -4,11 +4,10 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Source tutorial run functions
|
# Source tutorial run functions
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
application=$(getApplication)
|
|
||||||
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication setFields
|
runApplication setFields
|
||||||
runApplication $application
|
runApplication $(getApplication)
|
||||||
runApplication -s sample foamPostProcess -func sample
|
runApplication -s sample foamPostProcess -func sample
|
||||||
|
./createGraphs
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
49
tutorials/modules/fluid/shockTube/createGraphs
Executable file
49
tutorials/modules/fluid/shockTube/createGraphs
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if ! which gnuplot > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
echo 'gnuplot not found - skipping graph creation' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
time=$(foamListTimes -latestTime)
|
||||||
|
|
||||||
|
graphFile=postProcessing/sample/$time/data.xy
|
||||||
|
|
||||||
|
gnuplot<<EOF
|
||||||
|
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||||
|
set output 'T.eps'
|
||||||
|
|
||||||
|
set xlabel 'l (m)'
|
||||||
|
set ylabel 'T (K)'
|
||||||
|
set ytics nomirror
|
||||||
|
set key center
|
||||||
|
|
||||||
|
plot "$graphFile" u 1:2 w l t 'T'
|
||||||
|
EOF
|
||||||
|
|
||||||
|
gnuplot<<EOF
|
||||||
|
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||||
|
set output 'U.eps'
|
||||||
|
|
||||||
|
set xlabel 'l (m)'
|
||||||
|
set ylabel 'T (K)'
|
||||||
|
set ytics nomirror
|
||||||
|
set key center
|
||||||
|
|
||||||
|
plot "$graphFile" u 1:3 w l t 'U'
|
||||||
|
EOF
|
||||||
|
|
||||||
|
gnuplot<<EOF
|
||||||
|
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||||
|
set output 'p.eps'
|
||||||
|
|
||||||
|
set xlabel 'l (m)'
|
||||||
|
set ylabel 'p (Pa)'
|
||||||
|
set ytics nomirror
|
||||||
|
set key center
|
||||||
|
|
||||||
|
plot "$graphFile" u 1:4 w l t 'p'
|
||||||
|
EOF
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -14,7 +14,9 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
application rhoCentralFoam;
|
application foamRun;
|
||||||
|
|
||||||
|
solver shockFluid;
|
||||||
|
|
||||||
startFrom latestTime;
|
startFrom latestTime;
|
||||||
|
|
||||||
@ -16,12 +16,12 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
"(rho|rhoU|rhoE)"
|
"(rho|rhoU|rhoE).*"
|
||||||
{
|
{
|
||||||
solver diagonal;
|
solver diagonal;
|
||||||
}
|
}
|
||||||
|
|
||||||
U
|
"U.*"
|
||||||
{
|
{
|
||||||
solver smoothSolver;
|
solver smoothSolver;
|
||||||
smoother GaussSeidel;
|
smoother GaussSeidel;
|
||||||
@ -30,7 +30,7 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
e
|
"e.*"
|
||||||
{
|
{
|
||||||
$U;
|
$U;
|
||||||
tolerance 1e-10;
|
tolerance 1e-10;
|
||||||
@ -38,5 +38,8 @@ solvers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "0/uniform";
|
||||||
|
object time;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
beginTime 0;
|
||||||
|
|
||||||
|
value 0;
|
||||||
|
|
||||||
|
name "0";
|
||||||
|
|
||||||
|
index 0;
|
||||||
|
|
||||||
|
deltaT 1e-07;
|
||||||
|
|
||||||
|
deltaT0 1e-07;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
BIN
tutorials/modules/shockFluid/biconic25-55Run35/0/wallHeatFlux
Normal file
BIN
tutorials/modules/shockFluid/biconic25-55Run35/0/wallHeatFlux
Normal file
Binary file not shown.
@ -14,7 +14,9 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
application rhoCentralFoam;
|
application foamRun;
|
||||||
|
|
||||||
|
solver shockFluid;
|
||||||
|
|
||||||
startFrom latestTime;
|
startFrom latestTime;
|
||||||
|
|
||||||
@ -26,7 +28,7 @@ endTime 1e-3;
|
|||||||
|
|
||||||
deltaT 1e-7;
|
deltaT 1e-7;
|
||||||
|
|
||||||
writeControl adjustableRunTime;
|
writeControl runTime;
|
||||||
|
|
||||||
writeInterval 5e-5;
|
writeInterval 5e-5;
|
||||||
|
|
||||||
@ -44,11 +46,7 @@ timePrecision 6;
|
|||||||
|
|
||||||
runTimeModifiable true;
|
runTimeModifiable true;
|
||||||
|
|
||||||
adjustTimeStep yes;
|
adjustTimeStep no;
|
||||||
|
|
||||||
maxCo 0.5;
|
|
||||||
|
|
||||||
maxDeltaT 2e-8;
|
|
||||||
|
|
||||||
functions
|
functions
|
||||||
{
|
{
|
||||||
@ -16,12 +16,12 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
"(rho|rhoU|rhoE)"
|
"(rho|rhoU|rhoE).*"
|
||||||
{
|
{
|
||||||
solver diagonal;
|
solver diagonal;
|
||||||
}
|
}
|
||||||
|
|
||||||
U
|
"U.*"
|
||||||
{
|
{
|
||||||
solver smoothSolver;
|
solver smoothSolver;
|
||||||
smoother GaussSeidel;
|
smoother GaussSeidel;
|
||||||
@ -30,12 +30,18 @@ solvers
|
|||||||
relTol 0.01;
|
relTol 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
e
|
"e.*"
|
||||||
{
|
{
|
||||||
$U;
|
$U;
|
||||||
relTol 0.1;
|
relTol 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
maxCo 0.5;
|
||||||
|
maxDeltaT 2e-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -14,7 +14,9 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
application rhoCentralFoam;
|
application foamRun;
|
||||||
|
|
||||||
|
solver shockFluid;
|
||||||
|
|
||||||
startFrom startTime;
|
startFrom startTime;
|
||||||
|
|
||||||
@ -16,12 +16,12 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
"(rho|rhoU|rhoE)"
|
"(rho|rhoU|rhoE).*"
|
||||||
{
|
{
|
||||||
solver diagonal;
|
solver diagonal;
|
||||||
}
|
}
|
||||||
|
|
||||||
U
|
"U.*"
|
||||||
{
|
{
|
||||||
solver smoothSolver;
|
solver smoothSolver;
|
||||||
smoother GaussSeidel;
|
smoother GaussSeidel;
|
||||||
@ -30,7 +30,7 @@ solvers
|
|||||||
relTol 0.01;
|
relTol 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
h
|
"e.*"
|
||||||
{
|
{
|
||||||
$U;
|
$U;
|
||||||
tolerance 1e-10;
|
tolerance 1e-10;
|
||||||
@ -38,5 +38,8 @@ solvers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -19,6 +19,8 @@ internalField uniform 300;
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
movingWall
|
movingWall
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
@ -44,16 +46,6 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
back
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
|
|
||||||
front
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -19,6 +19,8 @@ internalField uniform (0 0 0);
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
movingWall
|
movingWall
|
||||||
{
|
{
|
||||||
type movingWallVelocity;
|
type movingWallVelocity;
|
||||||
@ -45,16 +47,6 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type noSlip;
|
type noSlip;
|
||||||
}
|
}
|
||||||
|
|
||||||
back
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
|
|
||||||
front
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -19,6 +19,8 @@ internalField uniform 1e5;
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
movingWall
|
movingWall
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
@ -44,16 +46,6 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type zeroGradient;
|
type zeroGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
back
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
|
|
||||||
front
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -19,16 +19,18 @@ internalField uniform 0;
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
movingWall
|
movingWall
|
||||||
{
|
{
|
||||||
type uniformFixedValue;
|
type uniformFixedValue;
|
||||||
uniformValue constant 160;
|
uniformValue constant 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
farFieldMoving
|
farFieldMoving
|
||||||
{
|
{
|
||||||
type uniformFixedValue;
|
type uniformFixedValue;
|
||||||
uniformValue constant 160;
|
uniformValue constant 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedWall
|
fixedWall
|
||||||
@ -47,16 +49,6 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type slip;
|
type slip;
|
||||||
}
|
}
|
||||||
|
|
||||||
back
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
|
|
||||||
front
|
|
||||||
{
|
|
||||||
type wedge;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -1,9 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
# Parse arguments for library compilation
|
# Source tutorial clean functions
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
(wmake $targetType BCs && wmake $targetType)
|
rm -rf constant/meshToMesh*
|
||||||
|
|
||||||
|
cleanCase
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
25
tutorials/modules/shockFluid/movingCone/Allrun
Executable file
25
tutorials/modules/shockFluid/movingCone/Allrun
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
application=$(getApplication)
|
||||||
|
|
||||||
|
mapTimes="1e-05 2e-05"
|
||||||
|
|
||||||
|
# Iterate the string variable using for loop
|
||||||
|
for mapTime in $mapTimes; do
|
||||||
|
|
||||||
|
runApplication -a blockMesh -dict blockMeshDict_$mapTime
|
||||||
|
rm -rf constant/meshToMesh_$mapTime
|
||||||
|
mkdir constant/meshToMesh_$mapTime
|
||||||
|
mv constant/polyMesh constant/meshToMesh_$mapTime
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
runApplication -a blockMesh
|
||||||
|
|
||||||
|
runApplication $application
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
43
tutorials/modules/shockFluid/movingCone/Allrun-parallel
Executable file
43
tutorials/modules/shockFluid/movingCone/Allrun-parallel
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
mapTimes="1e-05 2e-05"
|
||||||
|
|
||||||
|
# Iterate the string variable using for loop
|
||||||
|
for mapTime in $mapTimes; do
|
||||||
|
|
||||||
|
runApplication -a blockMesh -dict blockMeshDict_$mapTime
|
||||||
|
runApplication -a decomposePar -force -noFields -dict decomposeParDict_$mapTime
|
||||||
|
|
||||||
|
rm -rf constant/meshToMesh_$mapTime
|
||||||
|
mkdir constant/meshToMesh_$mapTime
|
||||||
|
|
||||||
|
for procI in processor*
|
||||||
|
do
|
||||||
|
mv $procI/constant/polyMesh constant/meshToMesh_$mapTime/$procI
|
||||||
|
done
|
||||||
|
|
||||||
|
mv constant/polyMesh constant/meshToMesh_$mapTime
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
runApplication -a blockMesh -dict blockMeshDict
|
||||||
|
runApplication -a decomposePar -force
|
||||||
|
|
||||||
|
for mapTime in $mapTimes; do
|
||||||
|
|
||||||
|
for procI in processor*
|
||||||
|
do
|
||||||
|
mkdir $procI/constant/meshToMesh_$mapTime
|
||||||
|
mv constant/meshToMesh_$mapTime/$procI $procI/constant/meshToMesh_$mapTime/polyMesh
|
||||||
|
done
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
52
tutorials/modules/shockFluid/movingCone/U
Normal file
52
tutorials/modules/shockFluid/movingCone/U
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
movingWall
|
||||||
|
{
|
||||||
|
type movingWallVelocity;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
farFieldMoving
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedWall
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type pressureInletOutletVelocity;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
farField
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -27,4 +27,16 @@ mover
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
topoChanger
|
||||||
|
{
|
||||||
|
type meshToMesh;
|
||||||
|
|
||||||
|
libs ("libmeshToMeshTopoChanger.so");
|
||||||
|
|
||||||
|
times (1e-5 2e-5);
|
||||||
|
|
||||||
|
timeDelta 1e-9;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
54
tutorials/modules/shockFluid/movingCone/pointMotionUx
Normal file
54
tutorials/modules/shockFluid/movingCone/pointMotionUx
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class pointScalarField;
|
||||||
|
object pointMotionUx;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
#includeEtc "caseDicts/setConstraintTypes"
|
||||||
|
|
||||||
|
movingWall
|
||||||
|
{
|
||||||
|
type uniformFixedValue;
|
||||||
|
uniformValue constant 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
farFieldMoving
|
||||||
|
{
|
||||||
|
type uniformFixedValue;
|
||||||
|
uniformValue constant 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedWall
|
||||||
|
{
|
||||||
|
type uniformFixedValue;
|
||||||
|
uniformValue constant 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type uniformFixedValue;
|
||||||
|
uniformValue constant 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
farField
|
||||||
|
{
|
||||||
|
type slip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -41,15 +41,20 @@ vertices
|
|||||||
|
|
||||||
blocks
|
blocks
|
||||||
(
|
(
|
||||||
hex (0 1 5 4 0 1 13 12) (15 15 1) simpleGrading (1 1 1)
|
hex (0 1 5 4 0 1 13 12) (8 15 1) simpleGrading (1 1 1)
|
||||||
hex (2 3 7 6 2 3 15 14) (20 20 1) simpleGrading (2 0.25 1)
|
hex (2 3 7 6 2 3 15 14) (20 20 1) simpleGrading (2 0.25 1)
|
||||||
hex (4 5 9 8 12 13 17 16) (15 15 1) simpleGrading (1 1 1)
|
hex (4 5 9 8 12 13 17 16) (8 15 1) simpleGrading (1 1 1)
|
||||||
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||||
hex (6 7 11 10 14 15 19 18) (20 15 1) simpleGrading (2 1 1)
|
hex (6 7 11 10 14 15 19 18) (20 15 1) simpleGrading (2 1 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
boundary
|
boundary
|
||||||
(
|
(
|
||||||
|
internal
|
||||||
|
{
|
||||||
|
type internal;
|
||||||
|
faces ();
|
||||||
|
}
|
||||||
movingWall
|
movingWall
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.001;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-7.5 0 0)
|
||||||
|
(-5.5 0 0)
|
||||||
|
(-2 0 0)
|
||||||
|
(0 0 0)
|
||||||
|
(-7.5 0.75 -0.03271454)
|
||||||
|
(-5.5 0.75 -0.03271454)
|
||||||
|
(-2 2 -0.087238774)
|
||||||
|
(0 2 -0.087238774)
|
||||||
|
(-7.5 2.5 -0.10904846)
|
||||||
|
(-5.5 2.5 -0.10904846)
|
||||||
|
(-2 2.5 -0.10904846)
|
||||||
|
(0 2.5 -0.10904846)
|
||||||
|
(-7.5 0.75 0.03271454)
|
||||||
|
(-5.5 0.75 0.03271454)
|
||||||
|
(-2 2 0.087238774)
|
||||||
|
(0 2 0.087238774)
|
||||||
|
(-7.5 2.5 0.10904846)
|
||||||
|
(-5.5 2.5 0.10904846)
|
||||||
|
(-2 2.5 0.10904846)
|
||||||
|
(0 2.5 0.10904846)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 5 4 0 1 13 12) (16 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (2 3 7 6 2 3 15 14) (10 20 1) simpleGrading (2 0.25 1)
|
||||||
|
hex (4 5 9 8 12 13 17 16) (16 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (6 7 11 10 14 15 19 18) (10 15 1) simpleGrading (2 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
internal
|
||||||
|
{
|
||||||
|
type internal;
|
||||||
|
faces ();
|
||||||
|
}
|
||||||
|
movingWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 5 13 1)
|
||||||
|
(5 6 14 13)
|
||||||
|
(2 2 14 6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
farFieldMoving
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(9 17 18 10)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
fixedWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 15 3)
|
||||||
|
(7 11 19 15)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
axis
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 1 0)
|
||||||
|
(2 3 3 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 0 12 4)
|
||||||
|
(4 12 16 8)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
farField
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(8 16 17 9)
|
||||||
|
(10 18 19 11)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type wedge;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 5 1)
|
||||||
|
(2 6 7 3)
|
||||||
|
(4 8 9 5)
|
||||||
|
(5 9 10 6)
|
||||||
|
(6 10 11 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type wedge;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 13 12)
|
||||||
|
(2 3 15 14)
|
||||||
|
(12 13 17 16)
|
||||||
|
(13 14 18 17)
|
||||||
|
(14 15 19 18)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.001;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-7.5 0 0)
|
||||||
|
(-4 0 0)
|
||||||
|
(-0.5 0 0)
|
||||||
|
(0 0 0)
|
||||||
|
(-7.5 0.75 -0.03271454)
|
||||||
|
(-4 0.75 -0.03271454)
|
||||||
|
(-0.5 2 -0.087238774)
|
||||||
|
(0 2 -0.087238774)
|
||||||
|
(-7.5 2.5 -0.10904846)
|
||||||
|
(-4 2.5 -0.10904846)
|
||||||
|
(-0.5 2.5 -0.10904846)
|
||||||
|
(0 2.5 -0.10904846)
|
||||||
|
(-7.5 0.75 0.03271454)
|
||||||
|
(-4 0.75 0.03271454)
|
||||||
|
(-0.5 2 0.087238774)
|
||||||
|
(0 2 0.087238774)
|
||||||
|
(-7.5 2.5 0.10904846)
|
||||||
|
(-4 2.5 0.10904846)
|
||||||
|
(-0.5 2.5 0.10904846)
|
||||||
|
(0 2.5 0.10904846)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 5 4 0 1 13 12) (25 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (2 3 7 6 2 3 15 14) (5 20 1) simpleGrading (2 0.25 1)
|
||||||
|
hex (4 5 9 8 12 13 17 16) (25 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||||
|
hex (6 7 11 10 14 15 19 18) (5 15 1) simpleGrading (2 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
internal
|
||||||
|
{
|
||||||
|
type internal;
|
||||||
|
faces ();
|
||||||
|
}
|
||||||
|
movingWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 5 13 1)
|
||||||
|
(5 6 14 13)
|
||||||
|
(2 2 14 6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
farFieldMoving
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(9 17 18 10)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
fixedWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 15 3)
|
||||||
|
(7 11 19 15)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
axis
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 1 0)
|
||||||
|
(2 3 3 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 0 12 4)
|
||||||
|
(4 12 16 8)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
farField
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(8 16 17 9)
|
||||||
|
(10 18 19 11)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type wedge;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 5 1)
|
||||||
|
(2 6 7 3)
|
||||||
|
(4 8 9 5)
|
||||||
|
(5 9 10 6)
|
||||||
|
(6 10 11 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type wedge;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 13 12)
|
||||||
|
(2 3 15 14)
|
||||||
|
(12 13 17 16)
|
||||||
|
(13 14 18 17)
|
||||||
|
(14 15 19 18)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -14,7 +14,9 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
application rhoCentralFoam;
|
application foamRun;
|
||||||
|
|
||||||
|
solver shockFluid;
|
||||||
|
|
||||||
startFrom startTime;
|
startFrom startTime;
|
||||||
|
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 1 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (4 1 1);
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 1 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (4 1 1);
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 1 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -59,7 +59,7 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cellMotionUx
|
"cellMotionUx.*"
|
||||||
{
|
{
|
||||||
solver PCG;
|
solver PCG;
|
||||||
preconditioner DIC;
|
preconditioner DIC;
|
||||||
@ -72,7 +72,7 @@ PIMPLE
|
|||||||
{
|
{
|
||||||
momentumPredictor yes;
|
momentumPredictor yes;
|
||||||
correctPhi yes;
|
correctPhi yes;
|
||||||
nOuterCorrectors 2;
|
nOuterCorrectors 1;
|
||||||
nCorrectors 2;
|
nCorrectors 2;
|
||||||
transonic yes;
|
transonic yes;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user