CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] setField : bug (dam example)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 2 Post By wyldckat
  • 2 Post By CFDMagnus
  • 1 Post By CFDMagnus

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2015, 11:57
Default setField : bug (dam example)
  #1
FGH
New Member
 
Franck HOUSSEN
Join Date: Feb 2015
Posts: 7
Rep Power: 11
FGH is on a distinguished road
On the dam example (http://www.openfoam.org/docs/user/damBreak.php), I run :
  1. blockMesh
  2. cp 0/alpha.water.org 0/alpha.water
  3. setField
  4. paraFoam
I can not see alpha in paraview (the only variable that is avaliable is U) : I can not get figure 2.21 from http://www.openfoam.org/docs/user/damBreak.php. I run Ubuntu 14.04 + OpenFOAM-2.3.1 (compiled from source)



I guess this is a bug



FGH
FGH is offline   Reply With Quote

Old   February 28, 2015, 16:25
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: We are not associated to the NSA, therefore we're not able to see what you're doing in your computer

Anyway, try following these instructions: http://openfoamwiki.net/index.php/Ho...iphase_results
vatavuk and randolph like this.
wyldckat is offline   Reply With Quote

Old   December 13, 2016, 04:52
Default
  #3
New Member
 
Ray
Join Date: Oct 2010
Posts: 1
Rep Power: 0
meshmaster is on a distinguished road
I couldn't see the alpha.water values either in the setup even though I had the cell array value checked for alpha.water. After I solved the simulation with interFoam I did get the results shown in the rest of the tutorial. I think it might be a bug, I am using OpenFOAM 3.0.1
meshmaster is offline   Reply With Quote

Old   November 18, 2018, 13:20
Default
  #4
New Member
 
Magnus Hoffmann
Join Date: Sep 2018
Posts: 4
Rep Power: 7
CFDMagnus is on a distinguished road
Digging this up from two years ago, now using OpenFOAM 6.
It's been bugging me for a while and what works for me is:

After executing setFields, there's two alpha.water files:

alpha.water (the correct one, verify it by editing it, there should be a long list of 1&0s), if so setField worked correctly

alpha.water-orig (or similar) this is the original alpha.water setup file (there should be boundary conditions for your patches).

i used to rename them (or setFields does that, i don't remember) but turns out that's not enough, as the header stil says alpha.water

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
move it to a different directory and paraview should display everything correctly.
I'm curious if it's only a Paraview thing and solvers read in the correct file.
mbookin and jan.kracik like this.
CFDMagnus is offline   Reply With Quote

Old   December 22, 2018, 11:24
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick question @CFDMagnus: I'm a bit confused by your description, because I haven't managed to figure out what was the problem exactly...

Any chance you can describe the steps you take that lead to the problem?
__________________
wyldckat is offline   Reply With Quote

Old   December 22, 2018, 12:07
Default
  #6
New Member
 
Magnus Hoffmann
Join Date: Sep 2018
Posts: 4
Rep Power: 7
CFDMagnus is on a distinguished road
The problem is for 2 or more phase problems that the setFields seems to have no effect. Paraview won't show the which internal cells are water/air. It will only show the initial conditions, let's say inlet is displayed with water but walls, atmosphere etc. only air.

For a two phase problem i usually want the domain to be partly filled with water at t=0. I will execute setfields, which overrides alpha.water.

The tutorials (and many online tut videos(shout out to Jozsef Nagy) suggest to keep the original alpha.water file under a different name before executing setFields.

Every once in a while, paraview will display the initial alpha.water, instead of the desired, after setfields was excecuted. I don't think that is an OpenFOAM problem but related to Paraview. I GUESS that is because paraview checks the headings of the files, which still contains the title alpha.water and gets confused, which one to display.

It's not much of an issue but really annoying. Simply moving the originial alpha.water to a different location solves the problem.


Hope this was more clear this time
jan.kracik likes this.
CFDMagnus is offline   Reply With Quote

Old   December 22, 2018, 17:23
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Mmm... ooooh! I didn't know this would happen...

So if I understood you correctly - and I'm using OpenFOAM 6 here too - the problem is because the "alpha.water.orig" field is not shown in the list of fields to be rendered, neither with ParaView's internal reader nor OpenFOAM's reader for ParaView...

At least regarding OpenFOAM 6, a feature was added in OpenFOAM to support automatic loading of the ".orig" fields if the actual fields don't exist yet. For example, if only "alpha.water" field doesn't exist yet, then it loads the field "alpha.water.orig" automatically as an alternative. This is why setFields is able to do it so without us having to copy the field as in the past.

So, yes, you'll have to either copy the file out of the folder or have it in the folder with another name. The "object" entry within the file isn't always read and it's there mostly for the user to know the last name it was written as...


As for the internal reader in ParaView, I'm not sure why exactly it ignores both the "object" entry and the file name itself... at least in ParaView 5.4...
wyldckat is offline   Reply With Quote

Old   June 16, 2022, 08:05
Default Thank you
  #8
New Member
 
Join Date: May 2022
Posts: 2
Rep Power: 0
JVNR is on a distinguished road
Quote:
Originally Posted by CFDMagnus View Post
Digging this up from two years ago, now using OpenFOAM 6.
It's been bugging me for a while and what works for me is:

After executing setFields, there's two alpha.water files:

alpha.water (the correct one, verify it by editing it, there should be a long list of 1&0s), if so setField worked correctly

alpha.water-orig (or similar) this is the original alpha.water setup file (there should be boundary conditions for your patches).

i used to rename them (or setFields does that, i don't remember) but turns out that's not enough, as the header stil says alpha.water

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
move it to a different directory and paraview should display everything correctly.
I'm curious if it's only a Paraview thing and solvers read in the correct file.
JUST COMMING HERE TO SAY THANK YOU. I'VE WASTED 2 HOURS OF MY TIME TRYING TO FIX THIS.

From now on I'll stick to having 0.orig and just copying the whole directory
JVNR is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
mapFields major bug alchem OpenFOAM Bugs 14 September 15, 2023 12:48
Bug in Workbench CFX Pierre1 CFX 6 August 2, 2017 00:18
Thermal and stress modelling of a dam quimperval OpenFOAM Running, Solving & CFD 0 August 22, 2014 11:08
Dam break simulation water level decreases over time aarratia FLUENT 1 May 9, 2014 10:25
3D dam break modeling(earthen dam) yasharif FLUENT 0 December 11, 2011 01:25


All times are GMT -4. The time now is 09:37.