From 5d08ffe94714b0600004b9cb73484f3f4d713942 Mon Sep 17 00:00:00 2001 From: ignis Date: Fri, 28 Oct 2016 21:08:17 +0900 Subject: [PATCH] plasmaReactingFoam removes mvConvection from ne transport and electron drift Courant Number --- .../combustion/plasmaReactingFoam/YEqn.H | 4 +- .../plasmaReactingFoam/createFields.H | 3 +- .../plasmaReactingFoam/electronCourantNo.H | 51 +++++++++++++++++++ .../plasmaReactingFoam/plasmaReactingFoam.C | 1 + .../combustion/plasmaReactingFoam/setDeltaT.H | 1 + 5 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 applications/solvers/combustion/plasmaReactingFoam/electronCourantNo.H diff --git a/applications/solvers/combustion/plasmaReactingFoam/YEqn.H b/applications/solvers/combustion/plasmaReactingFoam/YEqn.H index 0cf07576..7f0c1087 100644 --- a/applications/solvers/combustion/plasmaReactingFoam/YEqn.H +++ b/applications/solvers/combustion/plasmaReactingFoam/YEqn.H @@ -132,7 +132,8 @@ tmp > mvConvection if (Y[i].name() == electronSpecie) { - Udrift = - linearInterpolate(mue*E/ng); + Udrift = - linearInterpolate + ((mue/ng)*E - ((De/ng/Te)*fvc::grad(Te))); ve = (Udrift & mesh.Sf()) + q; // Wall electron flux correction @@ -166,7 +167,6 @@ tmp > mvConvection ( fvm::ddt(ne) + fvm::div(ve, ne) - // - mvConvection->fvmDiv(fvc::interpolate(De/ng/Te*fvc::grad(Te)) & mesh.Sf(), ne) - fvm::laplacian(De/ng, ne) == electronR diff --git a/applications/solvers/combustion/plasmaReactingFoam/createFields.H b/applications/solvers/combustion/plasmaReactingFoam/createFields.H index ebc80d0a..fbdee77d 100644 --- a/applications/solvers/combustion/plasmaReactingFoam/createFields.H +++ b/applications/solvers/combustion/plasmaReactingFoam/createFields.H @@ -79,7 +79,8 @@ volScalarField Phi ); Info<< "Creating field electric field\n" << endl; -volVectorField E( +volVectorField E +( IOobject ( "E", diff --git a/applications/solvers/combustion/plasmaReactingFoam/electronCourantNo.H b/applications/solvers/combustion/plasmaReactingFoam/electronCourantNo.H new file mode 100644 index 00000000..44728c0c --- /dev/null +++ b/applications/solvers/combustion/plasmaReactingFoam/electronCourantNo.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 . + +Global + CourantNo + +Description + Calculates and outputs the mean and maximum Courant Numbers from electron flux. + +\*---------------------------------------------------------------------------*/ + +scalar CoNumVe = 0.0; +scalar meanCoNumVe = 0.0; + +if (mesh.nInternalFaces()) +{ + scalarField sumPhi + ( + fvc::surfaceSum(mag(ve))().internalField() + ); + + CoNumVe = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); + + meanCoNumVe = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); +} + +Info<< "Electron Courant Number mean: " << meanCoNumVe + << " max: " << CoNumVe << endl; + +// ************************************************************************* // diff --git a/applications/solvers/combustion/plasmaReactingFoam/plasmaReactingFoam.C b/applications/solvers/combustion/plasmaReactingFoam/plasmaReactingFoam.C index bdc28195..dac1623c 100644 --- a/applications/solvers/combustion/plasmaReactingFoam/plasmaReactingFoam.C +++ b/applications/solvers/combustion/plasmaReactingFoam/plasmaReactingFoam.C @@ -65,6 +65,7 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" #include "compressibleCourantNo.H" + #include "electronCourantNo.H" #include "setDeltaT.H" runTime++; diff --git a/applications/solvers/combustion/plasmaReactingFoam/setDeltaT.H b/applications/solvers/combustion/plasmaReactingFoam/setDeltaT.H index 8a289574..88a215d8 100644 --- a/applications/solvers/combustion/plasmaReactingFoam/setDeltaT.H +++ b/applications/solvers/combustion/plasmaReactingFoam/setDeltaT.H @@ -66,6 +66,7 @@ if (pulseTimeStep) } else if (adjustTimeStep) { + CoNum = max(CoNum, CoNumVe); scalar maxDeltaTFact = maxCo/(CoNum + SMALL); scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);