|
[Sponsors] |
June 11, 2014, 08:35 |
dynamic scalar transport solver
|
#1 |
New Member
|
Hello,
I want to introduce the dynamic mesh option to a scalar transport solver "ScalarTransportFoam".. There is no diffusion term to be solved in the equation, only pure convection and transient term. I don't know what include files should i put in the solver and in the create fields file . Please take a view on what I have in my files and I appreciate any comments. The MyMovingScalarTransportFoam.C is below Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 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 MySolver Description Solves a transport equation for a passive scalar \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "dynamicFvMesh.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createDynamicFvMesh.H" #include "createFields.H" #include "readTimeControls.H" surfaceScalarField phiAbs ( IOobject ( "phiAbs", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), linearInterpolate(U) & mesh.Sf() ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating scalar transport\n" << endl; while (runTime.loop()) { #include "CourantNo.H" #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; phi = phiAbs; mesh.update(); solve ( fvm::ddt(T) + fvm::div(phi,T) ); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************************************* // Code:
Info<< "Reading field T\n" << endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); # include "createPhi.H" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ANSYS Meshing] Help with element size | sandri_92 | ANSYS Meshing & Geometry | 14 | November 14, 2018 08:54 |
new scalar transport eqn. with new density | Tobi | OpenFOAM Programming & Development | 0 | September 3, 2012 09:18 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
Generic Scalar Transport Equations | venkyr56 | Main CFD Forum | 4 | February 6, 2011 06:20 |
Unsteady kE with scalar transport - Outlet-geometry heavely effects scalar transport | christian_andersen | OpenFOAM | 0 | June 25, 2009 04:00 |