|
[Sponsors] |
August 14, 2020, 07:46 |
Velocity in OpenFoam
|
#1 |
Member
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9 |
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)) Code:
max(mag(U_iteration1-U_iteration2)) 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. |
|
August 14, 2020, 10:18 |
|
#2 |
Member
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9 |
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; } |
|
Tags |
arithmetic, openfoam |
|
|
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 |