CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Reconstruct created field

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2020, 06:57
Default Reconstruct created field
  #1
New Member
 
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7
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!

Alvaro
pardoa is offline   Reply With Quote

Old   March 6, 2020, 08:11
Default
  #2
New Member
 
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7
pardoa is on a distinguished road
This is the object function I wrote:
Quote:
head
{
type coded;
functionObjectLibs ("libutilityFunctionObjects.so");
name head;
writeControl writeTime;
codeExecute
#{
// 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
(
IOobject
(
"head",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ
),
(p_river/(-9.81*1000))+(faceCentres_river & vector(0,0,1))
);

// Write out only at output times selected for the simulation
if(mesh().time().outputTime())
{
head.write();
}
#};
}
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.

Álvaro
pardoa is offline   Reply With Quote

Reply

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
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem cico0815 OpenFOAM Community Contributions 36 February 3, 2022 11:54
funkySetBoundaryFields - Manipulation of existing field jhertel OpenFOAM Pre-Processing 16 May 18, 2020 06:32
decomposePar fails: supplied field size is not equal to target patch size AndrewF OpenFOAM Pre-Processing 0 September 11, 2016 02:55
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 21:54.