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

potentialFoam, erasing the U and p fields

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By HPE
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2020, 06:53
Default potentialFoam, erasing the U and p fields
  #1
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
hello,
I am trying to use potentialFoam to initialize my case and have a better initial field for simpleFoam for a laminar flow.
for this to my fvSolution i added in the solvers phi {$p} so it use the same solver of p field and the potentialFlow{nNonOrthogonalCorrectors 3;}
i have my 0.orig folder that i copy to the 0 and then run potentialFoam and then run simpleFoam.
the issue I am facing is that when i run the potentialFoam application, it erases the initial field from the (U and p file that is in the 0 folder) and also the inlet boundary goes from fixedValue, value uniform (...) to fixedValue, value nonuniform 0(); .
i do not understand what i am doing wrong, i am attaching the U and p files before and after potentialFoam, and also my controlDict, fvSolution and fvSchemes files.
the geometry is a quarter of cylinder with two symetry planes.
also copy the log of potentialFoam appli:
Quote:
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 7-1ff648926f77
Exec : potentialFoam
Date : May 08 2020
Time : 11:39:58
Host : "DESKTOP-DUTB7J5-otaolafr"
PID : 4530
I/O : uncollated
Case : /mnt/c/Users/Microreactors/Documents/OpenFOAM_Simulations/crearMeshWithPatches/Simulation_block_snap_topo_creat_simpleF
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading velocity field U

Constructing pressure field p

Constructing velocity potential field Phi

No MRF models present


Calculating potential flow
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
Continuity error = 0
Interpolated velocity error = 0
ExecutionTime = 30.16 s ClockTime = 30 s

End
best regards
Attached Files
File Type: zip filesPotentialFoam.zip (4.5 KB, 8 views)
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 07:20
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
>> the issue I am facing is that when i run the potentialFoam application, it erases the initial field from the (U and p file that is in the 0 folder) and also the inlet boundary goes from fixedValue, value uniform (...) to fixedValue, value nonuniform 0(); .

Executing potentialFoam will overwrite the U field, and optionally p and phi fields (if you add options, e.g. "potentialFoam -writep").

potentialFoam solves for the "velocity potential" (Wikipedia), and derives a new velocity field from it. That's why "U" boundary content is changed from "uniform" to "nonuniform" with new values.

As a side note, I have been using potentialFoam to initialise viscous computations, but never laminar computations. Would you teach us why would executing potentialFoam would be helpful for laminar cases?
HPE is offline   Reply With Quote

Old   May 8, 2020, 07:38
Default
  #3
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
>> the issue I am facing is that when i run the potentialFoam application, it erases the initial field from the (U and p file that is in the 0 folder) and also the inlet boundary goes from fixedValue, value uniform (...) to fixedValue, value nonuniform 0(); .

Executing potentialFoam will overwrite the U field, and optionally p and phi fields (if you add options, e.g. "potentialFoam -writep").

potentialFoam solves for the "velocity potential" (Wikipedia), and derives a new velocity field from it. That's why "U" boundary content is changed from "uniform" to "nonuniform" with new values.

As a side note, I have been using potentialFoam to initialise viscous computations, but never laminar computations. Would you teach us why would executing potentialFoam would be helpful for laminar cases?
hello, I know that it overwrites the 0 files, thats why I am having the stock files in 0.orig. what i meant is that from what I learned it overwrites the internalFields but it what I am getting is the edited the inlet boundary and the internalFields edited (going the two of them to zero) what I find extremely strange as potentialFoam, if I understand correctly is to initialize and this would not change the boundary conditions but only the internalFields.

Quote:
Would you teach us why would executing potentialFoam would be helpful for laminar cases?
hope that I am misunderstanding and the sarcasm in the phrase it is only that I am misreading it.I wanted to have an initialFields that is better than only a uniform value, so it would speed up the conversion of the simulation and also as a scholar case to learn how to use it.
best regards.
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 07:47
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
>> hope that I am misunderstanding and the sarcasm in the phrase it is only that I am misreading it.I wanted to have an initialFields that is better than only a uniform value, so it would speed up the conversion of the simulation and also as a scholar case to learn how to use it.
best regards.

- There was zero sarcasm. My apologies for misunderstanding. I was just curious, and wanted to learn.
- Could you please post the "U" file? Overwriting the inlet boundary may be leading to the same inlet boundary? Let's see.
HPE is offline   Reply With Quote

Old   May 8, 2020, 07:56
Default
  #5
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
>> hope that I am misunderstanding and the sarcasm in the phrase it is only that I am misreading it.I wanted to have an initialFields that is better than only a uniform value, so it would speed up the conversion of the simulation and also as a scholar case to learn how to use it.
best regards.

- There was zero sarcasm. My apologies for misunderstanding. I was just curious, and wanted to learn.
- Could you please post the "U" file? Overwriting the inlet boundary may be leading to the same inlet boundary? Let's see.
cool , dont worry, at least for me english it is not my first language so i prefere to ask ehehe.
yes i post it in the zip file in the first post, but i can copy paste here:
the first one is before doing potential (i put in the same quote the U and p file):

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];// m/s
//[kg m s K mol A cd] [kilogram metre second Kelvin mole ampere candela]

internalField uniform (0 0 0.1);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0.2);
}

outlet
{
type zeroGradient;
}

wall
{
type noSlip;
}

sym_1
{
type symmetry;
}

sym_2
{
type symmetry;
}
}

// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0]; // m^2/s^2
//[kg m s K mol A cd] [kilogram metre second Kelvin mole ampere candela]
internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

wall
{
type zeroGradient;
}

sym_1
{
type symmetry;
}

sym_2
{
type symmetry;
}
}

// ************************************************** *********************** //
after potential (U, p and phi also):
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform (0 0 0);

boundaryField
{
wall
{
type noSlip;
}
inlet
{
type fixedValue;
value nonuniform 0();
}
outlet
{
type zeroGradient;
}
sym_1
{
type symmetry;
}
sym_2
{
type symmetry;
}
}


// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0]; // m^2/s^2
//[kg m s K mol A cd] [kilogram metre second Kelvin mole ampere candela]
internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

wall
{
type zeroGradient;
}

sym_1
{
type symmetry;
}

sym_2
{
type symmetry;
}
}

// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "0";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform 0;

boundaryField
{
wall
{
type calculated;
value uniform 0;
}
inlet
{
type calculated;
value nonuniform 0();
}
outlet
{
type calculated;
value nonuniform 0();
}
sym_1
{
type symmetry;
value uniform 0;
}
sym_2
{
type symmetry;
value uniform -0;
}
}


// ************************************************** *********************** //
as you can see the inlet goes from:
inlet {type fixedValue;value uniform (0 0 0.2);}
to:
inlet {type fixedValue;value nonuniform 0();}

and the internalField goes from:
internalField uniform (0 0 0.1);
to:
internalField uniform (0 0 0);

best regards!
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 08:14
Default
  #6
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Oh, ok, got you. Hmm..

- One issue seems to be that there is no potentialFoam iterations carried out for Phi:

Quote:
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
- Why was this happened? hmm - so far nothing caught my eye as an issue. Need to create an example, and test on it.
- If the case is quick to run, would you try "potentialFoam -initialiseUBCs"?
- Is z-direction the streamwise flow direction?
HPE is offline   Reply With Quote

Old   May 8, 2020, 12:18
Default
  #7
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
Oh, ok, got you. Hmm..

- One issue seems to be that there is no potentialFoam iterations carried out for Phi:



- Why was this happened? hmm - so far nothing caught my eye as an issue. Need to create an example, and test on it.
- If the case is quick to run, would you try "potentialFoam -initialiseUBCs"?
- Is z-direction the streamwise flow direction?
yup a little bit strange...yeah of course i can test! the good think is i keept the mesh so it is only restore the 0 folder and run potentialFoam.
so, i tried potentialFoam -initialiseUBCs with same results (and the files look the same):
Quote:
Create time

Create mesh for time = 0

Reading velocity field U

Constructing pressure field p

Constructing velocity potential field Phi

No MRF models present


Calculating potential flow
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
Continuity error = 0
Interpolated velocity error = 0
ExecutionTime = 31.76 s ClockTime = 33 s

End
yes, it is a quarter of cylinder with two symmetry planes, and the axis in the Z direction. with the inlet in Z=0 and outlet at Z=L
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 14:16
Default
  #8
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
- Could you please tell me whether it is possible for you to share the case? (if it is not confidential)?
HPE is offline   Reply With Quote

Old   May 8, 2020, 16:00
Default
  #9
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
- Could you please tell me whether it is possible for you to share the case? (if it is not confidential)?
yeah no problem,you can use the Allrun scripts they work properly (it is OF v7)
Attached Files
File Type: zip Sim.zip (19.3 KB, 13 views)
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 17:22
Default
  #10
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

- To my finding, the "inlet" and "outlet" patches were mistakenly defined inside wall patch. Check "constant/boundary" file, and you will see that the "inlet" and "outlet" boundaries have zero faces. You can also visualise it in paraview by selecting the "wall" only. Hence, zero potentialFoam iterations.

- EDIT: Besides, you may want to refine the surface edges of the cylinder by adjusting snapping settings etc. Please have a look at the forum for further information.

Hope this helps.
granzer likes this.
HPE is offline   Reply With Quote

Old   May 9, 2020, 13:44
Default
  #11
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
Hi,

- To my finding, the "inlet" and "outlet" patches were mistakenly defined inside wall patch. Check "constant/boundary" file, and you will see that the "inlet" and "outlet" boundaries have zero faces. You can also visualise it in paraview by selecting the "wall" only. Hence, zero potentialFoam iterations.

- EDIT: Besides, you may want to refine the surface edges of the cylinder by adjusting snapping settings etc. Please have a look at the forum for further information.

Hope this helps.
thanks a lot! and sorry for bothering when it was not something potentialFoam related!
yes i will have a look,
best regards
franco
otaolafr is offline   Reply With Quote

Old   May 9, 2020, 13:47
Default
  #12
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
pleasure - and good luck.
otaolafr likes this.
HPE is offline   Reply With Quote

Old   August 14, 2022, 13:24
Default
  #13
Senior Member
 
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 102
Rep Power: 14
ufocfd is on a distinguished road
why does it write the solution to the "0" dir, rather than to "1"
ufocfd is offline   Reply With Quote

Reply

Tags
potentialfoam, simplefoam initialisation


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
OpenFOAM v4.1 - farfield bc potentialFoam jeytsav OpenFOAM Running, Solving & CFD 0 November 23, 2016 10:06
potentialFoam doesnt start?! Sway OpenFOAM Running, Solving & CFD 0 July 2, 2015 08:48
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 12:25
an odd(at least for me!) reconstructPar error on a field immortality OpenFOAM Running, Solving & CFD 3 June 3, 2013 23:36
PostChannel maka OpenFOAM Post-Processing 5 July 22, 2009 10:15


All times are GMT -4. The time now is 00:22.