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

postProcess utility with fixedProfile boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2024, 15:12
Default postProcess utility with fixedProfile boundary condition
  #1
New Member
 
Nils Tilton
Join Date: Aug 2024
Posts: 8
Rep Power: 2
NilsTilton is on a distinguished road
Dear OpenFOAM community,

I am having an issue using the postProcess utility to sample data from a simulation that uses the fixedProfile boundary condition. I am using OpenFOAM version v2460 on a Mac OS. Here's the issue:

I am simulating a 2D Poisson equation of the form nabla^2=f(x,y) with Dirichlet conditions on all boundaries. I use the lapacianFoam solver and add the source term f(x,y) using fvOptions. I sample data from the completed simulation using the postProcess utility with the sampleDict file below. It samples the temperature at the cell centers.

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object sampleDict;
}

type sets;
sets
{

CellCenters
{
type cellCentre;
axis xyz;
}

}
interpolationScheme cellPoint;
setFormat raw;
fields (T);


Everything works great when I apply uniform temperatures on all boundaries using OpenFOAM's "fixedValue" condition. I successfully sample data and compare with an analytical solution. However, when I modify my boundary conditions to apply variable temperatures along the boundaries, the simulation runs fine and I can plot the results using ParaView without issue. However, the postProcess utility outputs an error. For example, I apply the condition T=cos(y) along the west boundary using the following fixedProfile in my 0/T file:

west
{
type fixedProfile;
profile coded
name westBC

codeInclude #{ #};
code
#{
return scalar
(
cos(x)
);
#};
direction (0 1 0);
origin 0;

}

I try to sample the data using the command "laplacianFoam -postProcess -func sampleDict -latestTime"

I then get the following output to screen:

Create time

Create mesh for time = 4


SIMPLE: convergence criteria
field T tolerance 1e-10

Sampled set:
CellCenters -> raw

Time = 4
Reading field T

--> FOAM Warning :
--> FOAM FATAL IO ERROR: (openfoam-2406)


file: 4/T/boundaryField/west at line 1055 to 1071.

From static Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<double>::New(const Foam::word &, const Foam::entry *, const Foam::dictionary &, const Foam::word &, const Foam:bjectRegistry *, const bool) [Type = double]
in file /Volumes/OpenFOAM-v2406/src/OpenFOAM/lnInclude/Function1New.C at line 140.

End


I looked at the 4/T file, and see it has something to do with the west boundary condition above. The lines 1055-1071 are:

boundaryField
{
west
{
type fixedProfile;
profile
{
type fixedProfile;
profile coded name westBC codeInclude #{ #};
code #{
return scalar
(
cos(x)
);
#};
direction ( 0 1 0 );
origin 0;
}
direction (0 1 0);
origin 0;
value nonuniform List<scalar>
32
(
0.998795456205
0.989176509965
0.970031253195
...
...
NilsTilton is offline   Reply With Quote

Old   September 12, 2024, 16:53
Default
  #2
New Member
 
Nils Tilton
Join Date: Aug 2024
Posts: 8
Rep Power: 2
NilsTilton is on a distinguished road
For anyone that might run into this issue. I found I was able to postProcess, provided I used used runtime sampling. Basically I placed my sampleDict file within a function object in the controlDict file, as below. This read the data just fine. I'm guessing there is an issue with postProcess reading the time directories of a completed simulation using fixedProfile. But when run from sampleDict, it is getting the data directly from the solver?

functions
{

sampleDict // arbitrary name
{


type sets;
interpolationScheme cellPoint;
fields (T);
setFormat raw;
writeControl timeStep;
writeInterval 2;

sets
{

NodeValues // arbitrary name
{
type cellCentre;
axis xyz;
}

}
}
}
NilsTilton is offline   Reply With Quote

Reply

Tags
fixedprofile, openfoam, postprocess


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 05:13


All times are GMT -4. The time now is 09:41.