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

Initialization with potentialFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree14Likes
  • 1 Post By vmsandip2011
  • 11 Post By Sune
  • 2 Post By potentialFoam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2012, 04:05
Default Initialization with potentialFoam
  #1
New Member
 
Sune Niemann
Join Date: Aug 2011
Posts: 18
Rep Power: 14
Sune is on a distinguished road
I upgraded from 1.6.x to 2.1.0, and I noticed that it is now possible to include initialization of fields with potentialFoam, quite simply by including the potentialFlow keyword to the fvSolution dictionary, which is great. Using potentialFoam this way however, limits potentialFoam to use the same solvers and settings as used with for example simpleFoam.

Before I upgraded I used two fvSolution dicts, i.e fvSolution.potentialFoam and fvSolution.simpleFoam and then created a symbolic link to the fvSolution file before running potentialFoam or simpleFoam respectively. Does anyone know of a simpler way of setting solvers and their settings for simpleFoam and potentialFoam individually, using only one fvSolution file?

Thanks in advance

Sune
Sune is offline   Reply With Quote

Old   October 1, 2012, 06:22
Default How to run potentialFoam and simpleFoam together .
  #2
New Member
 
sandip
Join Date: Jan 2012
Posts: 20
Rep Power: 14
vmsandip2011 is on a distinguished road
I want to run the potentialFoam with few iterations and then run the simpleFoam using the same controlDict and fvSolution files , what changes are needed for openFoam2.1.0
Is it necessary to specify the residual controls in fvSolution file for simpleFoam.
Idea is to use results of potentialFoam for simpleFoam as intial conditions.

with regards.
Bashar likes this.
vmsandip2011 is offline   Reply With Quote

Old   October 1, 2012, 07:29
Default
  #3
New Member
 
Sune Niemann
Join Date: Aug 2011
Posts: 18
Rep Power: 14
Sune is on a distinguished road
Quote:
Originally Posted by vmsandip2011 View Post
I want to run the potentialFoam with few iterations and then run the simpleFoam using the same controlDict and fvSolution files , what changes are needed for openFoam2.1.0
Is it necessary to specify the residual controls in fvSolution file for simpleFoam.
Idea is to use results of potentialFoam for simpleFoam as intial conditions.

with regards.
You can easily use potentialFoam to initialize your fields with, just include the keyword potentialFlow at the end of your fvSolution file as shown in the code below.

Code:
solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-12;
        relTol          0.0001;
    }
 
    // And all the rest of your solvers 
}
 
SIMPLE
{
    nNonOrthogonalCorrectors  1;
    pRefPoint                 (0 0 0.5);
    pRefValue                 0;
 
    residualControl
    {
         p                       1e-9;
         U                       1e-9;
         //etc.
    }
}
 
potentialFlow
{
    nNonOrthogonalCorrectors 10;
}
Using the above code, will use 10 non-orthogonal corrector steps using whatever maxIter you have set for your solvers, giving nicely initialized fields.

So far as I know you can't use this same method to control the solution algorithms individually, which was what my question was about.
Sune is offline   Reply With Quote

Old   October 1, 2012, 07:57
Default
  #4
New Member
 
sandip
Join Date: Jan 2012
Posts: 20
Rep Power: 14
vmsandip2011 is on a distinguished road
Hi
Thanks for the reply .
I tried using fvSolution file as changes you have suggested , but I am getting following error
when I am running potentialFoam
.....
Create time
Create mesh for time = 0
Reading field p
Reading field U

Calculating potential flow
GAMG: Solving for p, Initial residual = 1.#QNAN, Final residual = 1.#QNAN, No Iterations 1000

--> FOAM FATAL ERROR:
Unknown functionEntry 'QNAN' in "IStringStream.sourceFile" near line 3
Valid functionEntries are :

4
(
codeStream
include
calc
includeIfPresent
)

From function functionEntry::execute(const word&, const dictionary&, primitiveEntry&, Istream&)
in file db/dictionary/functionEntries/functionEntry/functionEntry.C at line 129.

FOAM exiting

can you throw some light on what could be the wrong .

with regards
vmsandip2011 is offline   Reply With Quote

Old   October 1, 2012, 09:45
Default
  #5
New Member
 
Sune Niemann
Join Date: Aug 2011
Posts: 18
Rep Power: 14
Sune is on a distinguished road
I am not entirely sure what happened to your simulation, and probably some more experienced OF user could give you a better answer, but what I notice is:
Quote:
GAMG: Solving for p, Initial residual = 1.#QNAN, Final residual = 1.#QNAN, No Iterations 1000
- your initial residual at the point where the simulation crashes is QNAN, which I guess is a quite NAN, so you probably have some divergence or division by zero stuff going on.
- you have set the number of iterations to 1000 for GAMG under p in solvers. It will probably not solve your problem, but try and set maxIter to 10, to see if the error occurs instantaneously.

Also posting your entire fvSolution file would help.
Sune is offline   Reply With Quote

Old   August 27, 2015, 11:36
Default Continuity error with potentialFoam within a pimpleDyMFoam case
  #6
Member
 
Werner
Join Date: Jul 2015
Location: West Lafayette, USA
Posts: 34
Rep Power: 10
WernerW is on a distinguished road
Dear Forum,

I'm using the solver pimpleDyMFoam to simulate a wind Turbine and since the solver crashes with a floating point exception just after "bounding K" I decided to run potentialFoam to get make it easier for a simulation. I introduced the lines the potentialFlow call in fvSolution an the solver missed Phi setting in fvSolution/solvers. I copied such settings from the tutorial basics/potentialFoam/cylinder/system/fvSolution and potenfialFoam missed the word Phi in fvSchemes/fluxrequired. I added it imitating the tutorial again and now I'm getting a continuity error.

I'm pasting here parts I mentioned.

fvSolution
Quote:
solvers
{
Phi
{
solver GAMG;
smoother DIC;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;

tolerance 1e-06;
relTol 0.01;
}

pcorr
{
solver GAMG;
tolerance 1e-2;
relTol 0;
smoother DICGaussSeidel;
cacheAgglomeration no;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
maxIter 50;
}

p
{
$pcorr;
tolerance 1e-5;
relTol 0.01;
}

pFinal
{
$p;
tolerance 1e-6;
relTol 0;
}

"(U|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0.1;
}

"(U|k|epsilon)Final"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0;
}

}

PIMPLE
{
correctPhi yes; //it was no
nOuterCorrectors 10; //it was 2
nCorrectors 10; //it was 1
nNonOrthogonalCorrectors 10; //it was 0
// pRefCell 0;
// pRefValue 0;
}

potentialFlow
{
nNonOrthogonalCorrectors 10;
}


relaxationFactors
{
"(U|k|epsilon).*" 1;
}

cache
{
grad(U);
}
fvSchemes

Quote:
fluxRequired
{
default no;
pcorr ;
p ;
Phi ;
}
log.potentialFoam

Quote:
Create time

Create mesh for time = 0

Reading velocity field U

AMI: Creating addressing and weights between 159008 source faces and 157656 target faces
AMI: Patch source sum(weights) min/max/average = 0.506446, 1.49085, 1.00057
AMI: Patch target sum(weights) min/max/average = 0, 1.07114, 0.9962
Constructing pressure field p

Constructing velocity potential field Phi

No finite volume options present


Calculating potential flow
GAMG: Solving for Phi, Initial residual = 1, Final residual = 0.00595857, No Iterations 1
GAMG: Solving for Phi, Initial residual = 0.00387596, Final residual = 3.79732e-05, No Iterations 5
GAMG: Solving for Phi, Initial residual = 0.00059864, Final residual = 5.17713e-06, No Iterations 3
GAMG: Solving for Phi, Initial residual = 0.000123832, Final residual = 1.12705e-06, No Iterations 3
GAMG: Solving for Phi, Initial residual = 4.21444e-05, Final residual = 7.65505e-07, No Iterations 2
GAMG: Solving for Phi, Initial residual = 1.61331e-05, Final residual = 9.36259e-07, No Iterations 1
GAMG: Solving for Phi, Initial residual = 6.53836e-06, Final residual = 5.02959e-07, No Iterations 1
GAMG: Solving for Phi, Initial residual = 3.50903e-06, Final residual = 2.43923e-07, No Iterations 1
GAMG: Solving for Phi, Initial residual = 1.68593e-06, Final residual = 1.21885e-07, No Iterations 1
GAMG: Solving for Phi, Initial residual = 8.22673e-07, Final residual = 8.22673e-07, No Iterations 0
GAMG: Solving for Phi, Initial residual = 8.22673e-07, Final residual = 8.22673e-07, No Iterations 0
Continuity error = 3.49859e-06
Any clue about what may be the solution to my issue ? I'd greatly apreciate it.

best regards,
Werner
WernerW is offline   Reply With Quote

Old   March 2, 2016, 12:18
Default
  #7
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 10
potentialFoam is on a distinguished road
Dear Werner,

hope, you have already solved this issue... Nevertheless, some ideas:

For a potential flow, the continuity equation is solved (particularly the laplace equation when the velocity potential is introduced). Hence, the error of the approximate solution can be described as a continuity error.

Besides, I think, 10 nNonOrthogonalCorrectors steps are quite a few. See the following post(s) for more information:
http://www.cfd-online.com/Forums/ope...tml#post233066
Metti and Bashar like this.
potentialFoam 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
FMG initialization query Mohsin FLUENT 6 November 2, 2016 02:02
simple geometry and potentialFoam? Tobi OpenFOAM 0 June 21, 2012 16:39
Initialization a student Siemens 2 May 19, 2006 12:55
compressor initialization paglia FLUENT 0 February 1, 2006 15:14
Mesh Initialization shakked FLUENT 1 August 5, 2004 09:41


All times are GMT -4. The time now is 15:16.