|
[Sponsors] |
February 12, 2008, 15:24 |
Hi, All
Does anybody know h
|
#1 |
New Member
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 17 |
Hi, All
Does anybody know how to calculate residual of two scalar field with OpenFOAM? I wanna get shorter code then that: volScalarField residual("residual", T); residual == mag(analytical - T); doubleScalar maxResidual = 0.0; forAll(residual, i) { if (residual[i] > maxResidual) { maxResidual = residual[i]; } } residual = maxResidual; where analytical & T are of type volScalarField. |
|
February 12, 2008, 16:00 |
i.e. in my question i mean how
|
#2 |
New Member
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 17 |
i.e. in my question i mean how to find max element of volScalarField using OpenFOAM methods
|
|
February 13, 2008, 02:32 |
How about "max(residual)"...?
|
#3 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
How about "max(residual)"...?
|
|
February 13, 2008, 02:48 |
Ah, thanks. I found the decisi
|
#4 |
New Member
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 17 |
Ah, thanks. I found the decision by myself already.
max(mag(analytical - T)).value(); I was in trouble because i didn't use *.value(), then max(mag(analytical - T)) was returning not scalar value. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calculated Values in scalar field | arkangel | OpenFOAM Running, Solving & CFD | 0 | June 28, 2007 08:53 |
MeshPhi for scalar field in 14 gone | tehache | OpenFOAM Running, Solving & CFD | 0 | June 18, 2007 07:20 |
Passing scalar field across processors | ankgupta8um | OpenFOAM Running, Solving & CFD | 1 | June 7, 2006 04:32 |
Boundary scalar field | segersson | OpenFOAM Running, Solving & CFD | 1 | March 6, 2006 05:22 |
Set a fixed value of scalar in flow field. | Ke Su | FLUENT | 0 | June 20, 2003 15:47 |