CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Reconstruct created field

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2020, 06:57
Default Reconstruct created field
New Member
Álvaro Pardo
Join Date: May 2018
Posts: 21
Rep Power: 3
pardoa is on a distinguished road
Hi everyone,

I have defined a new function object to calculate the hydraulic head from the values of water pressure at the bottom of my problem domain. Since the area that I'm simulating is too big, I have split it into several pieces so as to run it in parallel using several cores.

The computation of the heads works very well at each processor but once I reconstruct the domain, the values of head are not merged as it happens to the rest of calculated fields.

Can anyone give me a hand on this? Thanks!

pardoa is offline   Reply With Quote

Old   March 6, 2020, 08:11
New Member
Álvaro Pardo
Join Date: May 2018
Posts: 21
Rep Power: 3
pardoa is on a distinguished road
This is the object function I wrote:
type coded;
functionObjectLibs ("");
name head;
writeControl writeTime;
// Find the riverbed patch ID

label patchID = mesh().boundaryMesh().findPatchID("riverbed");

// Select pressure field at the riverbed patch

const volScalarField& p = mesh().lookupObject<volScalarField>("p");
const fvPatchScalarField& p_river = p.boundaryField()[patchID];

// Select face center coordinates of the riverbed patch

const fvPatchVectorField& faceCentres_river = mesh().C().boundaryField()[patchID];

// Create the hydraulic head field
IOField<scalar> head
(p_river/(-9.81*1000))+(faceCentres_river & vector(0,0,1))

// Write out only at output times selected for the simulation
As I said in my previous post, the resulting values are recorded into a file in the time sub-directories included in each of the processor directories.

I have checked the reconstructPar code and apparently it is not possible to reconstruct patchScalarFields but only volumes. Does anyone face this issue before? Many thanks in advance.

pardoa is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
decomposePar fails: supplied field size is not equal to target patch size AndrewF OpenFOAM Pre-Processing 0 September 11, 2016 02:55
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem cico0815 OpenFOAM Community Contributions 18 February 1, 2016 18:16
funkySetBoundaryFields - Manipulation of existing field jhertel OpenFOAM Pre-Processing 15 March 19, 2015 08:42
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 04:26

All times are GMT -4. The time now is 00:06.