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

Calculating Residuals of Field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2023, 02:19
Default Calculating Residuals of Field
  #1
New Member
 
Khoder Alshaar
Join Date: May 2021
Posts: 8
Rep Power: 5
khoder Alshaar is on a distinguished road
Hello,
I'm new to OpenFOAM programming. I'd like to know how to write a loop to calculate L1-norm or L2-norm residuals for a specific field at each time step and plot it if possible.

For example, we have the following function to calculate RSS after each time step:

RSS=\sqrt{\frac{\sum_{i=1}^{nCells}\left(\frac{\rho_{i}^n-\rho_{i}^{n-1}}{\rho_{i}^{n-1}}\right)^2}{nCells}}

How to write the loop to calculate RSS value.

Thank you in advance.
khoder Alshaar 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
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem cico0815 OpenFOAM Community Contributions 36 February 3, 2022 12:54
turbulence field omega stops solver woodie OpenFOAM Pre-Processing 1 January 9, 2022 11:42
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
Calculating the cosine of a Foam::scalar field RoE OpenFOAM 3 January 20, 2011 09:49
Residuals in the whole field Jeremie Vareilles FLUENT 1 February 8, 2007 12:42


All times are GMT -4. The time now is 07:08.