|
[Sponsors] |
September 5, 2017, 03:30 |
Local Nusselt number evaluation Open foam
|
#1 |
New Member
Join Date: Mar 2017
Posts: 9
Rep Power: 9 |
Dear all foamers (Experts),
I am a new to OpenFOAM thus I apologised if I used some wrong descriptions. I am simulating a problem with flow past heated cylinder (2D). As per directions provided in the tutorial, I inculcate the energy equation in icofoam. I checked the case for laminar flow at Re = 100. The results are okie with Strouhal number = 0.157. I provide the temperature of 350K to cylinder rest boundary conditions are same as given in openfoam tutorial of flow past cylinder. I want to draw Nusselt number variation within the curve length along the cylinder. I don't what should I added in my control dic or the .C and .H files so that i can evaluate it. Secondly the same i want to draw static pressure along cylinder curve length. I saw many peoples posted for Nusselt number before, but exactly what to write in the files I can't get. Please help me to resolve the issue. Thanks the forum and group members. |
|
September 7, 2017, 13:06 |
|
#2 |
Senior Member
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 117
Rep Power: 10 |
You should take a look to this papers, it works for me. If you have some troubles, let me know.
http://www.tfd.chalmers.se/~hani/kur...esentation.pdf http://www.tfd.chalmers.se/~hani/kur...ssonReport.pdf |
|
September 7, 2017, 13:09 |
|
#3 |
Senior Member
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 117
Rep Power: 10 |
What solver are you using? did you modify icofoam? why you didnt use buoyantBoussinesqPimpleFoam: Transient solver for buoyant, turbulent flow of incompressible fluids?
|
|
September 7, 2017, 21:52 |
|
#4 |
New Member
Join Date: Mar 2017
Posts: 9
Rep Power: 9 |
Thanks,
I am using icofoam. I modified my code according to tutorial. /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 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 icoFoam Description Transient solver for incompressible, laminar flow of Newtonian fluids. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "pisoControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" pisoControl piso(mesh); #include "createFields.H" #include "initContinuityErrs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; #include "CourantNo.H" // Momentum predictor fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) ); if (piso.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); } // --- PISO loop while (piso.correct()) { volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); // Update the pressure BCs to ensure flux consistency constrainPressure(p, U, phiHbyA, rAU); // Non-orthogonal pressure corrector loop while (piso.correctNonOrthogonal()) { // Pressure corrector fvScalarMatrix pEqn ( fvm::laplacian(rAU, p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); pEqn.solve(mesh.solver(p.select(piso.finalInnerIte r()))); if (piso.finalNonOrthogonalIter()) { phi = phiHbyA - pEqn.flux(); } } #include "continuityErrs.H" U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); } //paasive scalar transport equation-energy equation for heat transfer fvScalarMatrix TEqn ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) ); TEqn.relax(); TEqn.solve(); // Calculates dT/dy Info<< "Calculating gradT" << endl; label patchi = mesh.boundaryMesh().findPatchID("cylinder"); // calculate (dT/dy)_wall //gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); gradT.boundaryFieldRef()[patchi]=T.boundaryFieldRef()[patchi].snGrad(); scalar area1 = gSum(mesh.magSf().boundaryField()[patchi]); scalar sumField1 = 0; if (area1 > 0) { sumField1 = gSum ( mesh.magSf().boundaryField()[patchi] * gradT.boundaryField()[patchi] )/ area1; } Info<< " Average of gradT over patch 1 = " << sumField1 << endl; //label patchi = mesh.boundaryMesh().findPatchID("myPatch"); //gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************** *********************** // |
|
September 7, 2017, 21:53 |
|
#5 |
New Member
Join Date: Mar 2017
Posts: 9
Rep Power: 9 |
The create field file
Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); dimensionedScalar nu ( "nu", dimViscosity, transportProperties.lookup("nu") ); // DT thermal diffusion dimensionedScalar DT ( transportProperties.lookup("DT") ); Info<< "Reading field p\n" << endl; volScalarField p ( IOobject ( "p", 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 field T\n" << endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar ( "gradT", T.dimensions()/dimLength, 0 ) ); #include "createPhi.H" label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); mesh.setFluxRequired(p.name()); |
|
September 7, 2017, 21:55 |
|
#6 |
New Member
Join Date: Mar 2017
Posts: 9
Rep Power: 9 |
The Nusselt number and wall flux utility is also having .C file. I get confused that I have to copy the code in my icofoam .C and .H files.
regards |
|
February 17, 2018, 13:29 |
Nusselt calc for porouszones
|
#7 | |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 8 |
Quote:
so literally i don't have a wall/patch defined,while calculation gradT or Nusselt number. what i mean to say is all about how to calculate Nusselt number on porouszone surface. Regards, S.V.Ramana |
||
February 18, 2018, 12:00 |
error in openfoam
|
#8 |
New Member
Milad
Join Date: Feb 2018
Posts: 17
Rep Power: 8 |
hi
anybody know about this error in openfoam? create time FOAM FATAL IO ERROR cannot find file from function regI0object::readstream() in file db/regI0object/regI0objectRead.c at line 72 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] swak4foam for OpenFOAM 4.0 | mnikku | OpenFOAM Community Contributions | 80 | May 17, 2022 08:06 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
[OpenFOAM] Local Nusselt number evaluation Open foam | doon_1984 | ParaView | 0 | September 3, 2017 22:49 |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 15:03 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 08:19 |