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

Question about rhoSimpleFoam "if (transonic)"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2010, 14:36
Default Question about rhoSimpleFoam "if (transonic)"
  #1
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 16
universez is on a distinguished road
Hi,
I try to study rhoSimpleFoam. In the pEqn.H of rhoSimpleFoam, there is a line "if (transonic)" see below for the file. I understand the function of the that is using incompressible SIMPLE method for low mach number cases and adding convertive term for compressible flow. (by the way, the compressible part in the rhoSimpleFoam of OpenFoam-dev1.5 is different).

I did output the the value transonic by adding
"Info<<"transonic = "<<transonic<<endl;"
in the rhoSimpleFoam.

the output of the is always "0" (see below)

My question are :

1, how to control transonic? it is specified at somewhere or it is defined by mach number?

2, if transonic = 0, it is always solving an incompressible problem but not a compressible problem.

Thank
yu

==============================================

Time = 172
smoothSolver: Solving for Ux, Initial residual = 0.130169, Final residual = 6.88999e-05, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.120254, Final residual = 9.18545e-05, No Iterations 2
DILUPBiCG: Solving for h, Initial residual = 0.0154733, Final residual = 4.72774e-05, No Iterations 1
transonic = 0
GAMG: Solving for p, Initial residual = 0.277657, Final residual = 0.00683687, No Iterations 6
time step continuity errors : sum local = 5.41896, global = 0.830172, cumulative = 3.09577
rho max/min : 1.79102 1.26744
ExecutionTime = 53.24 s ClockTime = 68 s

===============================================





===========================================
below is the modified pEqu file in the folder of rhoSimpleFoam
================================================
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H();
UEqn.clear();
bool closedVolume = false;
Info<<"transonic = "<<transonic<<endl; // output transonic
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax(mesh.relaxationFactor("pEqn"));
pEqn.setReference(pRefCell, pRefValue);
// retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rho*rUA, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
}

#include "incompressible/continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

Yu

Last edited by universez; April 12, 2010 at 20:27.
universez is offline   Reply With Quote

Old   April 12, 2010, 15:04
Default
  #2
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 16
universez is on a distinguished road
I also tried to add the option in the fvSolution in the system folder.

SIMPLE
{
nNonOrthogonalCorrectors 0;
pMin pMin [ 1 -1 -2 0 0 0 0 ] 0.100;
rhoMax rhoMax [1 -3 0 0 0 0 0] 100;
rhoMin rhoMin [1 -3 0 0 0 0 0] 1e-3;
transonic true;
}

now output value is transonic is 1; see below for the output;

=================================================
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6.x-c9721e2ef326
Exec : rhoSimpleFoamMod
Date : Apr 12 2010
Time : 15:01:50
Host : yu-desktop
PID : 3665
Case : /home/yu/OpenFOAM/yu-1.6.x/run/bumper4/rhoSimpleFoam/vin10
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create mesh for time = 0
Reading thermophysical properties
Selecting thermodynamics package hPsiThermo<pureMixture<sutherlandTransport<specieT hermo<hConstThermo<perfectGas>>>>>
Reading field U
Reading/calculating face flux field phi
Creating turbulence model
Selecting RAS turbulence model laminar
Starting time loop
Time = 1
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 7.78637e-11, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 4.67024e-07, No Iterations 2
DILUPBiCG: Solving for h, Initial residual = 1, Final residual = 1.53609e-06, No Iterations 1
transonic = 1

--> FOAM FATAL IO ERROR:
Cannot find relaxationFactor for 'pEqn' or a suitable default value.

==============================================



But there is a new error.

Please help.

Yu

Last edited by universez; April 12, 2010 at 15:23.
universez is offline   Reply With Quote

Old   April 13, 2010, 11:38
Default
  #3
Member
 
Ngoc-Minh Truong
Join Date: Feb 2010
Location: Toulouse, France
Posts: 42
Rep Power: 16
truong_nm is on a distinguished road
Send a message via MSN to truong_nm
Just add 'pEqn .3' entry in your relaxationFactors
truong_nm is offline   Reply With Quote

Old   April 16, 2010, 15:32
Default Still no sure how to use transonic
  #4
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 16
universez is on a distinguished road
Thanks for your reply.
it can start calculation. but deverged.

Not sure how to use rhoSimpleFoam for a compressible flow.

It is correct to put "transonic" as "true" , like below, or not?

SIMPLE
{
nNonOrthogonalCorrectors 0;
pMin pMin [ 1 -1 -2 0 0 0 0 ] 0.100;
rhoMax rhoMax [1 -3 0 0 0 0 0] 100;
rhoMin rhoMin [1 -3 0 0 0 0 0] 1e-3;
transonic true;
}


In OF-1.5-dev, there is no option for transonic at all. Can some one explain why. Thanks

Yu
universez is offline   Reply With Quote

Old   April 17, 2010, 10:21
Default Transonic is unstable!
  #5
Member
 
Ngoc-Minh Truong
Join Date: Feb 2010
Location: Toulouse, France
Posts: 42
Rep Power: 16
truong_nm is on a distinguished road
Send a message via MSN to truong_nm
'transonic' is a boolean so you can put 'true' or 'yes'.
I have stability problems too with this boolean on As transonic equations are strongly non-linear, it seems quite difficult to make a computation converge. I am still investigating, especially trying to understand why density standard deviation (max minus min) is so high, even with both very low CFL number and relaxation factor for rho.
Hope it'll help.
truong_nm 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
Unanswered question niklas OpenFOAM 2 July 31, 2013 16:03
Question about Table applicaiton. universez OpenFOAM Running, Solving & CFD 0 January 12, 2010 20:31
Momentum equation discretization in rhoSimpleFoam mighelone OpenFOAM Running, Solving & CFD 0 October 16, 2007 04:51
CHANNEL FLOW: a question and a request Carlos Main CFD Forum 4 August 23, 2002 05:55
question K.L.Huang Siemens 1 March 29, 2000 04:57


All times are GMT -4. The time now is 13:40.