View Issue Details

IDProjectCategoryView StatusLast Update
0001845OpenFOAMBugpublic2020-11-21 21:36
ReporterDanielJ Assigned Tohenry  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionsuspended 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Summary0001845: potentialFoam fails to initialize pressure-driven flows
DescriptionPotentialFoam fails on a very simple pressure-driven flow (attached case).

"
GAMG: Solving for Phi, Initial residual = 0, Final residual = 0, No Iterations 0
Continuity error = 0
Interpolated velocity error = 0

Calculating approximate pressure field
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 100
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 100


--> FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 0 the word 'nan'
"

Looking at the source of potentialFoam it seams like it was designed only for "velocity-driven" flows.
TagsNo tags attached.

Activities

DanielJ

2015-09-04 08:01

reporter  

potentialTest.zip (37,460 bytes)

henry

2015-09-04 09:19

manager   ~0005322

> Looking at the source of potentialFoam it seams like it was designed only for "velocity-driven" flows.

Correct.

How would you change it to support pressure-driven flows?

DanielJ

2015-09-04 09:50

reporter   ~0005323

My quick answer would be to create Phi boundary field by cloning pressure boundary field and not just use its types.

henry

2015-09-04 09:55

manager   ~0005324

I do not believe that is correct. If you set a static pressure drop in a channel what do you think the velocity field from the potential solution should be?

DanielJ

2015-09-04 10:06

reporter   ~0005325

Yes, mu answer was silly. In a channel with a constant section area there cannot be a pressure drop in a potential solution.

DanielJ

2015-09-04 10:27

reporter   ~0005326

It would be nice though if potentialFoam could handle the totalPressure boundary condition, but I think it would require special handling of this type and modifying initial velocity patch field.

henry

2015-09-04 10:31

manager   ~0005327

I think this is equivalent to specifying the inlet velocity.

DanielJ

2015-09-04 10:41

reporter   ~0005328

Yes this is true from the "program's point of view" and this is why it can be done with this approach. But from the user's point of view he defines total pressure because he knows total pressure and does not know the velocity. The actual velocity will be calculated by the viscous simulation.

henry

2015-09-04 11:22

manager   ~0005329

If the user knows the inlet total pressure and the outlet static pressure the velocity can be estimated but it is likely that the approximate inlet velocity is already known. I suggest that this is used for the potential solution and then the inlet BC changed to total-pressure for the NS solver.

DanielJ

2015-09-04 12:12

reporter   ~0005330

Editing huge result files is not as sexy as it sounds :)

I think that it could be implemented in probably around 20 LOC. To make it elegant a virtual fucntion like 'velocityDependent' or maybe simply 'setsTotalPressure' could be added to fvPatchField. This way also uniformTotalPressure could be handled without explicit reference.

Backward compatibility in behavior and less burden on the user is very valuable.

henry

2015-09-04 12:43

manager   ~0005331

> Editing huge result files is not as sexy as it sounds :)

This is easily automated with scripts or the tools we already provide.

I do not see a need to expand the already large interface in fvPatchField just for this application, there are better ways.

How would you handle the case of several inlets and outlets with different total and static pressures? I am not convinced that any kind of potential solution based on the pressure boundary conditions will provide a pysical or useful velocity field.

Another option would be to provide an option to potentialFoam to read an alternative velocity field with BCs appropriate for the potential solution (esitimated, derived from total pressure or calculated by some other means) then solve for the potential velocity field from this and apply the solution to the real velocity field file.

DanielJ

2015-09-04 13:40

reporter   ~0005332

> This is easily automated with scripts or the tools we already provide.

True


> I do not see a need to expand the already large interface in fvPatchField just for this application, there are better ways.

You are probably right that this is a very specific problem and not a reason to modify fvPatchField. However a large interface (whatever that means) is in my opinion not a good reason to reject functionality.


> How would you handle the case of several inlets and outlets with different total and static pressures? I am not convinced that any kind of potential solution based on the pressure boundary conditions will provide a physical or useful velocity field.

Multiple inlets is not a problem. Only one outlet with pressure specified makes physical sense. To have multiple "outlets" with pressure specified you need a boundary condition that switches between fixedValue and totalPressure depending on the flow direction.


> Another option would be to provide an option to potentialFoam to read an alternative velocity field with BCs appropriate for the potential solution (esitimated, derived from total pressure or calculated by some other means) then solve for the potential velocity field from this and apply the solution to the real velocity field file.

This is a possible solution, but to use it user needs to go through the docs to find out what to do and why he needs to do this, instead of it "just working". Also if he does not know about this option beforehand and gets an error similar to mine he will not know why it happened and what to do, especially since it "worked" in the previous version.

henry

2020-11-21 21:36

manager   ~0011724

It is not clear what should be done here, funding will be required to implement and test the options.

Issue History

Date Modified Username Field Change
2015-09-04 08:01 DanielJ New Issue
2015-09-04 08:01 DanielJ File Added: potentialTest.zip
2015-09-04 09:19 henry Note Added: 0005322
2015-09-04 09:42 henry Severity major => feature
2015-09-04 09:50 DanielJ Note Added: 0005323
2015-09-04 09:55 henry Note Added: 0005324
2015-09-04 10:06 DanielJ Note Added: 0005325
2015-09-04 10:27 DanielJ Note Added: 0005326
2015-09-04 10:31 henry Note Added: 0005327
2015-09-04 10:41 DanielJ Note Added: 0005328
2015-09-04 11:22 henry Note Added: 0005329
2015-09-04 12:12 DanielJ Note Added: 0005330
2015-09-04 12:43 henry Note Added: 0005331
2015-09-04 13:40 DanielJ Note Added: 0005332
2020-11-21 21:36 henry Assigned To => henry
2020-11-21 21:36 henry Status new => closed
2020-11-21 21:36 henry Resolution open => suspended
2020-11-21 21:36 henry Note Added: 0011724