|
[Sponsors] |
March 21, 2012, 18:35 |
Non stationary simulation of a 2D cylinder
|
#1 |
Senior Member
|
Hi all;
I'm trying to run a non stationary simulation of a 2D circular cylinder and I have some questions: 1. If I use icoFoam (can I use it in my case?) I have a floating point exception due to the courant number. I can avoid that but I need to lower my time step below 0.000001. 2. If I use pisoFoam it complies about the empty patches… 3. [Warning - stupid question!] what's the different between using simpleFoam and saving the result at different time steps and using a non stationary solver? Even with simpleFoam I can get the vortex shedding… Thank you! Last edited by lovecraft22; April 3, 2012 at 11:13. |
|
March 23, 2012, 12:36 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
If you tar up the case I wouldn't mind taking a look at it.
|
|
March 23, 2012, 13:39 |
|
#3 |
Senior Member
|
Thank you kmooney.
Had to do a .zip file instead of a .tar because of the size allowance by the forum…I hope that's fine… |
|
April 3, 2012, 11:05 |
|
#4 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
The high Co numbers appear to be a result of some bad cells generated by snappyHexMesh. I added a little code to CoNumber.H to write out the local Courant numbers:
Code:
//Compute and write Co field scalar CoNum = 0.0; scalar meanCoNum = 0.0; volScalarField CoField ( IOobject ( "CoField", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), fvc::surfaceSum(mag(phi))() ); if (mesh.nInternalFaces()) { scalarField sumPhi ( fvc::surfaceSum(mag(phi))().internalField() ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); CoField.internalField() = 0.5*(CoField/mesh.V().field())*runTime.deltaTValue(); meanCoNum = 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum << " max: " << CoNum << endl; //END Co Number |
|
April 3, 2012, 11:21 |
|
#5 |
Senior Member
|
Thank you Kyle, I really appreciate you help.
I had noticed indeed that my extruded mesh was bad on the cylinder surface so I played a little bit with the snappyHexMesh parameters and eventually I got a really good looking surface mesh but, again, no look with the convergence… Could you please have a look at this case as well and see if the problem may be the same? The runScript is included. I got rid of the feature edges as it makes no differences for a 2D case like mine. Those lines you posted, is that just something you need to add at the bottom of your controlDict? Also, could you please explain the difference between running simpleFoam and looking at the flow at different time steps and doing the same thing with icoFoam? I know simpleFoam is a steady state solver but yet I can get the vortex shedding… is that just some numerical stuff? Thank you again for your help! |
|
May 4, 2012, 06:01 |
|
#6 |
New Member
Anne Severt
Join Date: May 2012
Posts: 4
Rep Power: 14 |
Hey Kyle,
I´m new to CFD and OpenFoam, but I´m very much interested in your CoField implementation. Could you explain to me how you created the pictures? I edited the CourantNo.H file as you described, but I can´t create the images of CoField. Thank you! I was able to get a pic, but they don´t change in time. Aren´t they supposed to change? Last edited by Anne Severt; May 7, 2012 at 11:21. |
|
May 4, 2012, 09:19 |
|
#7 | |
Senior Member
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20 |
Quote:
Regards V. |
||
May 7, 2012, 15:18 |
|
#8 | |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
Quote:
As far as I can tell the Co field should be changing as long as U or deltaT is changing. The values are only valid on the internal field however so the patch values aren't accurate. It's always possible there is a bug but I haven't spent much time at all on it. |
||
May 8, 2012, 03:06 |
|
#9 |
New Member
Anne Severt
Join Date: May 2012
Posts: 4
Rep Power: 14 |
Hey Kyle,
thanks for your answer. Is there a way to plot accurate patch values? How can I access the volScalarField to keep track of the values while time is running? Could you explain, why the patch values aren´t accurate? Thus, why is ().internalField() used? Thanks! Last edited by Anne Severt; May 11, 2012 at 06:32. |
|
August 2, 2016, 06:04 |
|
#10 |
Member
AdOo
Join Date: Mar 2016
Location: Bordeaux
Posts: 91
Rep Power: 10 |
Hi all,
I'm facing some problem of cfl and I would like to see the courant number on my mesh to know were comes my problem... I've seen that the code made by mister Mooney was able to do that, but I have two questions about how to implement it. FIRST: do we just have to copy this code on a file called CourantNo.H ? SECOND : were exactly do we have to put #include "CourantNo.H" in the XiFoam.C file ? Let see on the code below, HERE n°1 or n°2 or n°3 ? or non of them ? Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright held by original author \\/ 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application XiFoam Description Compressible premixed/partially-premixed combustion solver with turbulence modelling. Combusting RANS code using the b-Xi two-equation model. Xi may be obtained by either the solution of the Xi transport equation or from an algebraic exression. Both approaches are based on Gulder's flame speed correlation which has been shown to be appropriate by comparison with the results from the spectral model. Strain effects are encorporated directly into the Xi equation but not in the algebraic approximation. Further work need to be done on this issue, particularly regarding the enhanced removal rate caused by flame compression. Analysis using results of the spectral model will be required. For cases involving very lean Propane flames or other flames which are very strain-sensitive, a transport equation for the laminar flame speed is present. This equation is derived using heuristic arguments involving the strain time scale and the strain-rate at extinction. the transport velocity is the same as that for the Xi equation. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "hhuCombustionThermo.H" #include "compressible/RASModel/RASModel.H" #include "laminarFlameSpeed.H" #include "ignition.H" #include "Switch.H" HERE n°1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { # include "setRootCase.H" # include "createTime.H" # include "createMesh.H" # include "readCombustionProperties.H" # include "readEnvironmentalProperties.H" # include "createFields.H" # include "readPISOControls.H" # include "initContinuityErrs.H" # include "readTimeControls.H" # include "compressibleCourantNo.H" # include "setInitialDeltaT.H" HERE n°2 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { # include "readTimeControls.H" # include "readPISOControls.H" # include "compressibleCourantNo.H" # include "setDeltaT.H" HERE n°3 runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "rhoEqn.H" # include "UEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { # include "ftEqn.H" # include "bEqn.H" # include "huEqn.H" # include "hEqn.H" if (!ign.ignited()) { hu == h; } # include "pEqn.H" } turbulence->correct(); rho = thermo->rho(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return(0); } // ************************************************************************* // Adrien ORSINI |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
k-omega SST simulation of turbulent flow around a circular cylinder | DanM | OpenFOAM Running, Solving & CFD | 17 | October 13, 2016 14:29 |
benchmark: flow over a circular cylinder | goodegg | Main CFD Forum | 12 | January 22, 2013 12:47 |
Boundary condition setting regarding turbine simulation using CFX | Lacerlacer | CFX | 11 | March 12, 2012 10:32 |
modification for rotating cylinder simulation | zonexo | Main CFD Forum | 3 | July 21, 2006 15:24 |
Simulation of the Flow past a circular cylinder using STAR-CD | M. S. GUEROUACHE | Main CFD Forum | 0 | October 1, 1998 11:51 |