CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

rhoSimpleFoam doubts on BC and fvSchemes (external aero)

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By giovanni.medici
  • 1 Post By giovanni.medici

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2017, 18:24
Default rhoSimpleFoam doubts on BC and fvSchemes (external aero)
  #1
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 48
Rep Power: 12
giovanni.medici is on a distinguished road
Dear all,
I joined this forum few years ago, and have appreciated the tons of information it provides, I've read so many interesting posts, that I almost blush due to the questions I'm going to ask...
Recently I'm doing some experiments with openFOAM. I find the software really interesting, and there is unparalleled possibility to adjust it to the user needs, maybe after some (many) headaches …
My testcase is a low speed (34 [m/s] 3 m long rc aircraft), external aerodynamics, CFD case.

Due to the slow speed regime I've (with some success), modelled the problem using simpleFoam, kwSST, and run several AoA (0 to 10 [deg]).
The mesh is half airplane, unstructured, tetra, + hexa and pyramids on the BL more or less 5m elements. 10 layers of BoundaryLayer.
I’m currently trying to run rhoSimpleFoam, to introduce compressibility (which I expect should play a rather minor role, anyway it could, maybe, explain some differences between the results obtained with another solver).
The best result I could achieve is running ~200 iterations, with very low relaxation factors, and then, apparently after a residual bump, the run crashes (you could find the error among the attachments).
I would be so grateful if any of you could please answer some (several) questions that are hereby reported?
rhoSimpleFoam
1. Which would be the most suitable BC conditions in case one wants to use the same mesh with different AoA? Other solvers use quite frequently a sphere far-field / or half-sphere far field approach. I used a combination of symmetry and freestream BC. I’m particularly puzzeled as far as turbulence BC is concerned (some interesting information is available Problem running simpleFoam with kOmegaSST turbulence model) , in particular alphat?
2. The mesh as I said is not structured (I attached the checkMesh result), which is in your opinion, the most suitable combination in fvSolution and fvSchemes? I read several interesting posts about the opportunity to use potentialflow initialization , nonorthogonalCorrectors (nNonOrthogonalCorrectors), nCellsInCoarsestLevel (What are several parameters mean in fvSolution file?). Some of you prefer PBiCG to GAMG for U e and p. But I read that GAMG is more efficient in a small home cpu (6 cores). I tried so many different setups, I’m running out of ideas …
3. Would it be possible to use the (converged), solution of an incompressible case run with simpleFoam, as starting point for the compressible case (transform incompressible case in compressible case How?
simpleFoam
4. simpleFoam, is incompressible, thus p is specified as p/rho. Does this affect in whatsoever way the forces calculation? Beside the rho ratio, is p: static pressure, right?
5. If I specify 0 as p in the 0/ folder, the converged results, close to the far field, are a constant negative value of pressure, as if the parameter reported in the BC 0 file was a setting for the ptot. What operation do you currently use to output (or compute/calculate) the CP in paraview?
6. Apparently although I went up to 10 deg, the wing seems not to stall, which is quite an unexpected behavior. Possibly to capture such complex, instability of incipient stall I shall use a different solver (transient), such as centralFoam, I tried, but without any success.

Thanks

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{

    "(p|e)"
	{
	solver GAMG;
	tolerance 1e-8;
	relTol 0.1;
	smoother GaussSeidel;
	nPreSweeps 1;
	nPostSweeps 2;
	cacheAgglomeration on;
	agglomerator faceAreaPair;
	nCellsInCoarsestLevel 200;
	mergeLevels 1;
	}

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps         1;
        tolerance       1e-08;
        relTol          0.1;
    } 
	"rho.*"
    {
        solver          diagonal;
        tolerance       1e-05;
        relTol          0;
    }
		
	"(k|omega)"
	{
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
		nPreSweeps 1;
		nPostSweeps 0;
		cacheAgglomeration on;
		agglomerator faceAreaPair;
		mergeLevels 1;
	}

}

SIMPLE
{
	nCorrectors 1;
	nNonOrthogonalCorrectors 3;
	pRefCell 101325;
	pRefValue 101325;
	rhoMin 1.0;
	rhoMax 1.5;
	transonic       no;
    consistent      yes;
}

potentialFlow
	{
	nNonOrthogonalCorrectors 10;
	}

relaxationFactors
{
    fields
    {
        p               0.05;
		rho 			0.05;
    }
    equations
    {
		p 				0.3;
		U               0.2;
        k               0.5;
		omega           0.5;
		e 				0.05;
    }
}
	
	cache
	{
	grad(U);
	}
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


ddtSchemes
{
    default             steadyState;
}

gradSchemes
{
    default             Gauss linear;
	grad(U)         	cellLimited Gauss linear 1;
    grad(p)             Gauss linear;
	grad(e) 			cellLimited Gauss linear 1;
}

divSchemes
{
    default none;
	div(phi,k)      bounded Gauss upwind;
    div(phi,omega)  bounded Gauss upwind;
	div(phi,U) Gauss limitedLinear 1;
    div(((rho*nuEff)*dev2(T(grad(U)))))      Gauss linear;
	//div(phi,e) Gauss limitedLinear 1;
    div(phi,e)          bounded Gauss upwind;
    div(phid,p)         Gauss upwind;
    div(phi,Ekp)        bounded Gauss upwind;
    div((phi|interpolate(rho)),p)  Gauss upwind;
}

laplacianSchemes
{
	default Gauss linear corrected 0.33;
}

interpolationSchemes
{
    default                 linear;
}

snGradSchemes
{
	default         limited corrected 0.33;  
}

wallDist
{
    method meshWave;
}
Code:
FoamFile
{
	version 2.0;
	format binary;
	class dictionary;
	location "";
	object controlDict;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

application rhoSimpleFoam;

startFrom startTime; // latestTime

startTime	0.;

stopAt endTime;

endTime	4500;

deltaT 	1;

writeControl timeStep;

writeInterval	250;

purgeWrite	2;

writeFormat	binary;

writePrecision	6;

writeCompression	uncompressed;

timeFormat	general;

timePrecision	6;

graphFormat	raw;

runTimeModifiable	yes;

adjustTimeStep	off;

maxCo	1.25;

maxAlphaCo	0.;

maxDeltaT	1e-2;


functions

{
 residuals
    {
        type            residuals;
        functionObjectLibs ("libutilityFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;

        fields
        (
            p
            U
			k
			omega
			rho
			e
        );
    }
}

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
	type            heRhoThermo;
	mixture         pureMixture;
    transport       sutherland;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}


mixture
{
    // normalised gas
    specie
    {
        nMoles          1;
        molWeight       28.96;
    }
    thermodynamics
    {
        Cp              1004.5;
        Hf           2.544e+06;
    }
    transport
    {
        mu              1.8e-05; 
        Pr              0.7; 
		As          1.4792e-06;
        Ts          116;
    }
}

Code:
FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object p;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
#include        "include/initialConditions"


dimensions [1 -1 -2 0 0 0 0];

internalField uniform $pressure;


boundaryField
{
	botWt
	{
		type freestreamPressure;
	}
	topWt
	{
		type freestreamPressure;
	}
	outlet
	{
		type freestreamPressure;
	}
	sideWt
	{
		type freestreamPressure;
	}
	
	inlet
	{
		type freestreamPressure;
	}

	ldgAvoid
	{
		type zeroGradient;
	}

	sym
	{
		type symmetry;
	}
...
Code:
FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object T;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

#include        "include/initialConditions"


dimensions [0 0 0 1 0 0 0];

internalField uniform $temperature;


boundaryField
{
	"sideWt|botWt|topWt"
	{
		type zeroGradient;
	}

	outlet
	{
		type inletOutlet;
		inletValue $internalField;
		value $internalField;
	}

	inlet
	{
		type fixedValue;
		value $internalField;
	}

	ldgAvoid
	{
		type zeroGradient;
	}

	sym
	{
		type symmetry;
	}
...
Code:
FoamFile
{
	version 2.0;
	format binary;
	class volVectorField;
	location "";
	object U;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

#include        "include/initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform $flowVelocity;


boundaryField
{
	sideWt
	{
		type freestream;
		freestreamValue uniform $flowVelocity;
		rhoInlet $densityRef;
	}
	
	botWt
	{
		type freestream;
		freestreamValue uniform $flowVelocity;
		rhoInlet $densityRef;
		}
	topWt
	{
		type freestream;
		freestreamValue uniform $flowVelocity;
		rhoInlet $densityRef;
	}

	outlet
	{
		type freestream;
		freestreamValue uniform $flowVelocity;
		rhoInlet $densityRef;
	}

	inlet
	{
		type freestream;
		freestreamValue uniform $flowVelocity;
		rhoInlet $densityRef;
	}

	"ldgAvoid|flap|Aileron|VT|Rudder|elevator|HT|wing|fuselage"
	{
		type fixedValue;
		value uniform (0 0 0);
	}
	
	"NoseLDG|mainLDG"
	{
		type slip;
	}
	

	sym
	{
		type symmetry;
	}
Code:
FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object alphat;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [1 -1 -1 0 0 0 0];

internalField uniform 1e-6;

boundaryField
{
	"sideWt|botWt|topWt"
	{
	  type            zeroGradient;
	}

	outlet
	{
	  type zeroGradient;
	}

	inlet
	{
		type zeroGradient;
	}

	"ldgAvoid|flap|Aileron|VT|Rudder|elevator|HT|wing|fuselage"
	{
		type compressible::alphatWallFunction;
		Prt 0.85;
		value uniform	1e-6;
	}
	
	"NoseLDG|mainLDG"
	{
		type zeroGradient;
	}
	
	sym
	{
		type symmetry;
	}

}
Code:
FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object k;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 2 -2 0 0 0 0];

internalField 4.335;


boundaryField
{
	"sideWt|botWt|topWt"
	{
	  type            zeroGradient;
	}

	outlet
	{
	  type            inletOutlet;
        inletValue  uniform    $internalField;
        value       uniform    $internalField;
	}

	inlet
	{
		type fixedValue;
		value $internalField;
	}

	"ldgAvoid|flap|Aileron|VT|Rudder|elevator|HT|wing|fuselage"
	{
		type kqRWallFunction ;
		value uniform $internalField;
	}
	
	"NoseLDG|mainLDG"
	{
		type zeroGradient;
	}
	
	sym
	{
		type symmetry;
	}

}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 4.2;

boundaryField
{
	"sideWt|botWt|topWt"
	{
		type calculated;
		value uniform 0;
		//type inletOutlet;
		//inletValue $internalField;
		//value  $internalField;
	}

	outlet
	{
	type calculated;
		value uniform 0;
		//type inletOutlet;
		//inletValue $internalField;
		//value  $internalField;
	}

	inlet
	{
		type calculated;
		value uniform 0;
		//type fixedValue;
		//value  $internalField;
	}

	"ldgAvoid|flap|Aileron|VT|Rudder|elevator|HT|wing|fuselage"
	{
		type nutkWallFunction;
		value uniform 0;
	}

	"NoseLDG|mainLDG"
	{
			type nutkWallFunction;
			value uniform 0;
	}

	sym
	{
		type symmetry;
	}


}
Code:
FoamFile
{
	version 2.0;
	format binary;
	class volScalarField;
	location "";
	object omega;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


dimensions [0 0 -1 0 0 0 0];

internalField uniform 54.30;


boundaryField
{
	"sideWt|botWt|topWt"
	{
		type zeroGradient;
	}

	outlet
	{
		type inletOutlet;
		inletValue $internalField;
		value  $internalField;
	}

	inlet
	{
		type fixedValue;
		value $internalField;
	}

	"ldgAvoid|flap|Aileron|VT|Rudder|elevator|HT|wing|fuselage"
	{
		type omegaWallFunction;
		value  $internalField;
	}
	"NoseLDG|mainLDG"
	{
		type zeroGradient;

	}
	sym
	{
		type symmetry;
	}


}
INITIAL CONDITIONS
Code:
flowVelocity        (34. 0. 0.);
pressure            101325;
densityRef			1.225;
dpressure			0;
temperature         288;
turbulentKE         1000;
turbulentEpsilon    25000;
Attached Images
File Type: png residuals.png (81.4 KB, 81 views)
File Type: jpg CFD_out.jpg (67.8 KB, 47 views)
Attached Files
File Type: txt checkMesh.txt (3.9 KB, 8 views)
File Type: zip log.zip (27.7 KB, 3 views)
sk_malladi likes this.
giovanni.medici is offline   Reply With Quote

Old   July 23, 2017, 11:54
Default
  #2
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 48
Rep Power: 12
giovanni.medici is on a distinguished road
I think I solved most of the issues I had, now. I changed the BC using the information provided in this tutorial: https://community.dur.ac.uk/g.l.ingr...torial2012.pdf

and the thread rhoSimplecFoam: error in Forces output (correct pressure field)

which gave me the insight of using the temperature limiter. Now the rhoSimpleFoam converges accurately and the comparison with the other CFD solver are very encouraging.

As far as my doubts of total or static pressure of the simpleFoam solver, I think the answers, provided in the thread Pressure in OpenFOAM are complete, a must to be read

I attach the final version of BC (0), constant and system folder, as well as a residual convergence picture.
Attached Images
File Type: jpg residuals.jpg (125.9 KB, 112 views)
Attached Files
File Type: zip newBC.zip (9.7 KB, 70 views)
sk_malladi likes this.
giovanni.medici is offline   Reply With Quote

Old   October 26, 2021, 10:19
Default PDF link is broken
  #3
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Quote:
Originally Posted by giovanni.medici View Post
I changed the BC using the information provided in this tutorial: https://community.dur.ac.uk/g.l.ingr...torial2012.pdf
sadly the above link to the PDF tutorial is broken. I think The PDF can be found here. But if you came to this page looking for rhoSimpleFoam tutorials, you will be disappointed.
foadsf is offline   Reply With Quote

Old   October 27, 2021, 06:06
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
Possibly here
https://wiki.openfoam.com/index.php?title=Tutorials
https://wiki.openfoam.com/Collection...#Joel_Guerrero
https://wiki.openfoam.com/Collection...ichael_Alletto
dlahaye is offline   Reply With Quote

Reply

Tags
convergence, rhosimplefoam, simplefoam


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



All times are GMT -4. The time now is 14:49.