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

Velocity in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2020, 07:46
Default Velocity in OpenFoam
  #1
Member
 
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9
mkhm is on a distinguished road
Hi foamers,

My question is simple: U for each cell has 3 components for a 3D case and U is calculated for the whole domain, so many cell. Imagine that I want to find out the maximum value of the difference of U(iteration2) and U(iteration1) over the domain.


- for openfoam, which one is correct ?
1)
Code:
max(mag(U_iteration1)-mag(U_iteration2))
2)
Code:
max(mag(U_iteration1-U_iteration2))
Does the following notations are used by OpenFoam ?
U_cell(i)=[Ux Uy Uz]_cell(i):
U_iteration1=[ [Ux Uy Uz]_cell(1)
[Ux Uy Uz]_cell(2)
.

.
.
[Ux Uy Uz]_cell(n)];


mag(U_iteration1)=[ mag([Ux Uy Uz]_cell(1))
mag([Ux Uy Uz]_cell(2))
.

.
.
mag([Ux Uy Uz]_cell(n))];

Thanks for your help,
Mary

Last edited by mkhm; August 14, 2020 at 10:20.
mkhm is offline   Reply With Quote

Old   August 14, 2020, 10:18
Default
  #2
Member
 
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9
mkhm is on a distinguished road
In other terms, could we replace maxValU[/CODE] simply by:
Code:
max(mag(U_f)-mag(U_0))
?

Code:
 forAll(U_f,i)
        {
            DiffRhoU =mag(mag(U_f[i])-mag(U_0[i]));
            if(DiffU>maxValU)
            {
                maxValU=DiffU;
                posMaxU=i;
            }
            sumU_f  += mag(U_f[i]);
            sumDiffU += DiffU;
         }
mkhm is offline   Reply With Quote

Reply

Tags
arithmetic, openfoam


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
fully developed inlet velocity in openfoam mb.pejvak Main CFD Forum 0 May 17, 2019 11:15
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 07:15
Velocity cylindrical components from OpenFOAM aerospain OpenFOAM 2 October 17, 2012 08:09
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 04:29.