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

Limit values of a variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2024, 11:52
Default Limit values of a variable
  #1
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
I am using mapField to map a coverged solution from a coarse mesh to a fine one. When I re-start the simulation on the fine mesh, the simulation crashes at the beginning of the time loop.
I have discovered that there are a bunch of points (like 5 points) where omega (the turbulence variable) is very large, and I think this is the reason for the crash. Probably mapField is generating this large values do to the fact that the boundaries are not exactly the same (the two meshes are generated with snappyHexMesh).
Is there a way to locate these few points and correct omega manually?

Thanks in advance
giorgianig is offline   Reply With Quote

Old   March 13, 2024, 12:19
Default
  #2
Member
 
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 59
Rep Power: 3
unilord is on a distinguished road
Quote:
Originally Posted by giorgianig View Post
I am using mapField to map a coverged solution from a coarse mesh to a fine one. When I re-start the simulation on the fine mesh, the simulation crashes at the beginning of the time loop.
I have discovered that there are a bunch of points (like 5 points) where omega (the turbulence variable) is very large, and I think this is the reason for the crash. Probably mapField is generating this large values do to the fact that the boundaries are not exactly the same (the two meshes are generated with snappyHexMesh).
Is there a way to locate these few points and correct omega manually?

Thanks in advance
Easiest way would be to use upwind divScheme for turbulence constants, and cellLimited Gauss Linear 1 for grad Schemes until it starts converging.
unilord is offline   Reply With Quote

Old   March 13, 2024, 12:28
Default
  #3
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by unilord View Post
Easiest way would be to use upwind divScheme for turbulence constants, and cellLimited Gauss Linear 1 for grad Schemes until it starts converging.
The problem is that it diverges before starting the time loop. The limiting would kick-in after the first iteration.
giorgianig is offline   Reply With Quote

Old   March 13, 2024, 12:57
Default
  #4
Member
 
Shravan
Join Date: Mar 2017
Posts: 60
Rep Power: 9
Severus is on a distinguished road
Hello,
You have two options,
Option 1:
You can use limitFields functionObject: https://www.openfoam.com/documentati...mitFields.html
Note that the functionObject gets called in the beginning of the time loop, so it should work before things are computed in the first time step.
Check here: What is the trigger of the function objects??

Option 2:
If you can add piece of code inside your solver and recompile your solver, then I suggest you add something like this, before the time loop.
Lets say that the maximum allowable value of omega is max_value.
Then use
Code:
omega = min(omega,max_value);
Thanks
Severus is offline   Reply With Quote

Reply

Tags
limiting, mapfield


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
Y+ values exceed limit! James38 STAR-CCM+ 3 August 9, 2019 11:26
How to read variable values on a surface Comi Fluent UDF and Scheme Programming 3 April 3, 2019 21:33
3D equation, loading values for variable Cp from txt file with time-value columns AJAY BHANDARI OpenFOAM Programming & Development 11 January 1, 2016 05:16
How to monitor variable values of point at t=0 sec yunhee CFX 3 February 13, 2008 12:45
Tracing the variable values Neser25 CFX 0 November 7, 2005 10:26


All times are GMT -4. The time now is 11:35.