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

Solving a scalar field in a pure convection field

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2023, 10:13
Default Solving a scalar field in a pure convection field
  #1
New Member
 
Mohammad Hossein
Join Date: Dec 2023
Posts: 3
Rep Power: 2
smhk is on a distinguished road
Hello everyone,
I want to find a scalar (T) in a pure convection field which has a known velocity field.

I've tried to use scalarTransportFoam (I'm supposed to solve the field with that solver) but I got this message:
Code:
scalarTransportFoam has been superseded and replaced by the more general
functions solver module executed by the foamRun application:

    foamRun -solver functions

The solver specified by either the subSolver or if not present the solver entry
in the controlDict is instantiated to provide the physical fields needed by the
functionObjects.  The scalarTransport functionObject is then instantiated from
the functions entry in the controlDict and executed in a time-loop also
controlled by entries in controlDict and the maxDeltaT() returned by the
sub-solver.  See:

    tutorials/modules/incompressibleFluid/pitzDailyScalarTransport
So I tried to run it with foamRun and I got this one:


Code:
 FOAM FATAL ERROR:
cannot find file "/home/smhk/CFD_P/0/p"

    From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
    in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 539.

FOAM exiting
but there is no pressure field here so I removed the p file
What may I do? Thanks in advance



(I'm completely new and I'm using Openfoam11)
smhk is offline   Reply With Quote

Old   December 5, 2023, 11:46
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Interesting - in v8, you could get away without specifying a pressure field in the 0 folder, but you can't in v11 - it "needs" the p file to be present, but then presumably ignores it thereafter.

Solution: make sure you have a "dummy" p file in the 0 folder; I don't think that the values matter, so just put zero for the internal field and mirror the boundaries in your T file, eg:

Code:
boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    upperWall
    {
        type            zeroGradient;
    }
    lowerWall
    {
        type            zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
}
It should then run.

PS this may be worth entering a bug report ...
Tobermory is offline   Reply With Quote

Old   December 5, 2023, 16:08
Default
  #3
New Member
 
Mohammad Hossein
Join Date: Dec 2023
Posts: 3
Rep Power: 2
smhk is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
Interesting - in v8, you could get away without specifying a pressure field in the 0 folder, but you can't in v11 - it "needs" the p file to be present, but then presumably ignores it thereafter.

Solution: make sure you have a "dummy" p file in the 0 folder; I don't think that the values matter, so just put zero for the internal field and mirror the boundaries in your T file,

It should then run.

PS this may be worth entering a bug report ...

Thank you.


But this is also happening for other files is 0 directory:

Code:
--> FOAM FATAL ERROR:
cannot find file "/home/smhk/CFD_P/0/k"

    From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
     in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 539.
Maybe it's a problem from other parts such as controlDict or something?
CFD_P.zip


P.S. My classmate have done it in openfoam 6 by scalarTransportFoam.
smhk is offline   Reply With Quote

Old   December 6, 2023, 03:58
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Yes - it looks like it is trying to load all the components of the baseline solver before just carrying on with the scalar transport part, so i presume you'll have to have dummy versions of all of the files in the 0 folder. Or just use an earlier version of OpenFOAM - v8 works finr, as does v6 as you noted. Good luck.
smhk likes this.
Tobermory is offline   Reply With Quote

Reply

Tags
pure convection, scalarfield


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
chtMultiRegionSimpleFoam: maximum number of iterations excedeed. Nkl OpenFOAM Running, Solving & CFD 19 October 10, 2019 02:42
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 18:17
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16


All times are GMT -4. The time now is 12:23.