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

Creating new field by using createFields.H

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2021, 08:36
Default Creating new field by using createFields.H
  #1
New Member
 
Join Date: Jun 2021
Posts: 5
Rep Power: 5
Prantik Das is on a distinguished road
volScalarField Up
(
IOobject
(
"Up",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mag(U)*p
);

I am adding this line in createFields.H in myicoFoam solver which is nothing but the same solver icoFoam created in USER library. Then I am running the cavity case.

I am getting this file Up.C

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.5";
object Up;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 3 -3 0 0 0 0];

internalField uniform 0;

boundaryField
{
movingWall
{
type calculated;
value uniform 0;
}
fixedWalls
{
type calculated;
value uniform 0;
}
frontAndBack
{
type empty;
}
}


// ************************************************** *********************** //

at every time folder except 0/ as there is no <nonuniform> scalar written in it, I am unable to get it in paraview.

What is the possible solution to this problem?
Prantik Das is offline   Reply With Quote

Reply

Tags
c++, openfoam, programming


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
creating an internal field? maybee OpenFOAM Programming & Development 2 February 4, 2021 17:15
creating a field that is accessible by all processors szamani OpenFOAM Programming & Development 2 July 27, 2020 02:28
Cht tutorial in 15 braennstroem OpenFOAM Running, Solving & CFD 197 June 10, 2015 03:02
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
Help creating a field function to create a sine pressure wave Pleb STAR-CCM+ 2 February 17, 2011 12:16


All times are GMT -4. The time now is 20:14.