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

Plotting courant number from rhoPimpleFoam in paraview?

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 1 Post By KarenRei
  • 4 Post By RobertHB
  • 3 Post By miotto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2018, 22:19
Default Plotting courant number from rhoPimpleFoam in paraview?
  #1
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
I've got a simulation that's running abnormally slow in order to try to prevent exceeding its specified maximum courant number. Looking at the data in paraview, nothing appears out of the ordinary. So the idea obviously came to mind to plot the courant number itself in paraview / parafoam. However, "postProcess -func CourantNo" is giving up:

Code:
--> FOAM FATAL ERROR: 

    request for volScalarField rho from objectRegistry region0 failed
    available objects of type volScalarField are
1(surfaceSum(mag(phi)))

    From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /opt/OpenFOAM-v1806/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 239.
Thoughts?
miotto likes this.
KarenRei is offline   Reply With Quote

Old   October 2, 2018, 01:01
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
It is much easier to send the log file through a grep or awk script which gives the Courant number together with some other data like simulated time.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   October 2, 2018, 04:21
Default
  #3
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
OpenFoam also offers a Courant Number function which you can add to your controlDict.
Code:
functions
{
#includeFunc CourantNo
 }
Source.
And then you could use the foam monitor to plot the Co number if i'm not mistaken.
__________________
If you liked my answer to your question, please consider leaving a "Like" in return
RobertHB is offline   Reply With Quote

Old   October 2, 2018, 06:35
Default
  #4
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
Quote:
Originally Posted by piu58 View Post
It is much easier to send the log file through a grep or awk script which gives the Courant number together with some other data like simulated time.
That would give the max and average courant number, but not show where the number is high.
KarenRei is offline   Reply With Quote

Old   October 2, 2018, 06:36
Default
  #5
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
Quote:
Originally Posted by RobertHB View Post
OpenFoam also offers a Courant Number function which you can add to your controlDict.
Code:
functions
{
#includeFunc CourantNo
 }
Source.
And then you could use the foam monitor to plot the Co number if i'm not mistaken.
How would foamMonitor show me in what cells the courant number is high?
KarenRei is offline   Reply With Quote

Old   October 2, 2018, 08:29
Default
  #6
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
It doesn't, i misunderstood your endavour. You can always calculate your Co. in paraview with the calculator. But it will be an mirrorimage of your velocity.
__________________
If you liked my answer to your question, please consider leaving a "Like" in return
RobertHB is offline   Reply With Quote

Old   October 2, 2018, 08:32
Default
  #7
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
It's more than just velocity, the cell size with respect to the velocity vector matters. It's not enough just to display U in paraview.
KarenRei is offline   Reply With Quote

Old   February 18, 2020, 15:04
Default
  #8
Member
 
Gui Miotto
Join Date: Feb 2020
Posts: 30
Rep Power: 6
miotto is on a distinguished road
Quote:
Originally Posted by KarenRei View Post
I've got a simulation that's running abnormally slow in order to try to prevent exceeding its specified maximum courant number. Looking at the data in paraview, nothing appears out of the ordinary. So the idea obviously came to mind to plot the courant number itself in paraview / parafoam.

So here is how you do it:


First, you add the Courant number function object to your ControlDict:



Code:
functions
{
    Co1
    {
        type                CourantNo;
        libs                ("libfieldFunctionObjects.so");
        executeControl      timeStep;
        executeInterval     2;
        writeControl        writeTime;
    }
}
Run you simulation and open paraView. There you have to add the VolumeField Co by checking the "Co" checkbox under Properties/Volume Fields and clicking on apply.



Then advance to the second timestep of you simulation and the Co will be available for visualization (as the other regular variables - pressure, velocity, etc.)
miotto 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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 22:00
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 16:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


All times are GMT -4. The time now is 21:48.