CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Local Nusselt number evaluation Open foam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2017, 03:30
Default Local Nusselt number evaluation Open foam
  #1
New Member
 
Join Date: Mar 2017
Posts: 9
Rep Power: 9
doon_1984 is on a distinguished road
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.
doon_1984 is offline   Reply With Quote

Old   September 7, 2017, 13:06
Default
  #2
Senior Member
 
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 117
Rep Power: 10
dewey is on a distinguished road
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
dewey is offline   Reply With Quote

Old   September 7, 2017, 13:09
Default
  #3
Senior Member
 
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 117
Rep Power: 10
dewey is on a distinguished road
What solver are you using? did you modify icofoam? why you didnt use buoyantBoussinesqPimpleFoam: Transient solver for buoyant, turbulent flow of incompressible fluids?
dewey is offline   Reply With Quote

Old   September 7, 2017, 21:52
Default
  #4
New Member
 
Join Date: Mar 2017
Posts: 9
Rep Power: 9
doon_1984 is on a distinguished road
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;
}


// ************************************************** *********************** //
doon_1984 is offline   Reply With Quote

Old   September 7, 2017, 21:53
Default
  #5
New Member
 
Join Date: Mar 2017
Posts: 9
Rep Power: 9
doon_1984 is on a distinguished road
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());
doon_1984 is offline   Reply With Quote

Old   September 7, 2017, 21:55
Default
  #6
New Member
 
Join Date: Mar 2017
Posts: 9
Rep Power: 9
doon_1984 is on a distinguished road
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
doon_1984 is offline   Reply With Quote

Old   February 17, 2018, 13:29
Default Nusselt calc for porouszones
  #7
Member
 
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 8
svramana is on a distinguished road
Quote:
Originally Posted by doon_1984 View Post
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());
Hi, i need to calculate local Nusselt number variation along the surface length of porous square cylinder.In my case i have defined porous cylinder as porosity zones using topoSet and defined porosity as sink(Darcy-Forchheimer law).
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
svramana is offline   Reply With Quote

Old   February 18, 2018, 12:00
Default error in openfoam
  #8
New Member
 
Milad
Join Date: Feb 2018
Posts: 17
Rep Power: 8
milad092 is on a distinguished road
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
milad092 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 08:34.