CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   potentialFoam: request for volScalarField rho (https://www.cfd-online.com/Forums/openfoam-solving/163814-potentialfoam-request-volscalarfield-rho.html)

WhiteW December 6, 2015 12:41

potentialFoam: request for volScalarField rho
 
Hi, I'm trying to use potentalFoam in order to initialize the flow of an external aerodynamic.
The solver I want to use is rhoSimplecFoam and the analysis seems to work well with the setting I'm using.
However if I try to initilaize the flow with potentialFoam (using the comand "potentialFoam") I get the following error:

Code:

--> FOAM FATAL ERROR:

    request for volScalarField rho from objectRegistry region0 failed
    available objects of type volScalarField are

2
(
div(phi)
p
)


    From function objectRegistry::lookupObject<Type>(const word&) const
    in file /home/bedon/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198.

FOAM aborting


In fvSolution I have added the part:

Code:

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}


Am I missing something?
Thanks!
WhiteW

alexeym December 6, 2015 16:07

Hi,

potentialFoam itself neither creates nor looks up rho volume scalar field and since your error messages are rather trimmed, I could try to guess, you are using fvOptions or functionObjects, which request rho field. Also it is possible that you are using boundary conditions for velocity or pressure that require rho field.

WhiteW December 7, 2015 05:04

Hi, thanks for reply.
You are right, Im using both fvOptions and a p boundary that involves the use of rho. I report the 0/p file:


Code:

#include        "include/initialConditions"

dimensions      [1 -1 -2 0 0 0 0];

internalField  uniform $pressure;

boundaryField
{
      inflow
        {
                //typeA          zeroGradient;
                type            totalPressure;
                p0              uniform $totPressure;
                gamma          1.4;
                U              U;
                phi            phi;
                rho            rho;
                value          $internalField;
        }

        outflow
        {
                type            fixedValue;
                value          $internalField;
        }

#include "include/box"

        "(wall_fuselage|wall_nose)"
        {
                type            zeroGradient;
        }

So, if I woluld like to initialize the flow with potentialFoam, have I to change the boundary settings? And have I to changhe them back when the flowfield is initializated?
Thanks,
WhiteW

alexeym December 7, 2015 05:21

Hi,

You could either change boundary conditions (and remove fvOptions), initialize flow, revert changes; or create separate simplified case for potentialFoam and then use mapFields to map initialized flow field from potentialFoam case to your rhoSimplecFoam case.

WhiteW December 7, 2015 12:00

Thanks alexeym, I'll try to use mapFields!

WhiteW December 8, 2015 04:28

Ok, I have run the potentialFoam in an incompressible setting (simpleFoam).
I have obtained the internalField in 0/U.
Now in the original folder (where then I'll use rhoSimplecFoam) I run:
mapField -consistent
Is it the right command? I'm not sure about the consistent option, the geometry it is the same (identical number of cells), however the Boundary conditions change..

WhiteW

alexeym December 8, 2015 04:39

Hi,

It should be something like:

Code:

mapFields -fields '(U)' -sourceTime latestTime <path-to-your-potentialFoam-case>
About -consistent flag: verify. If it works, OK proceed with the next simulation, if not, try without the flag, if it works, OK proceed with the next simulation. If both ways fail, post question.

WhiteW December 8, 2015 12:04

Hi
the two folder I'm using are Base_potential (where I run the potentialFoam and I get the U with the initilaized internal field) and Base_potential2 (where I will run the rhoSimplecFoam.
I tried the command:

Code:

mapFields -fields '(U)' -sourceTime 0  /home/OF/Baseline_2.224_potential
However nothing seems to happen, the 0/U file is the same. I report the log of mapFields:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : mapFields /home/OF/Base_potential -consistent
Date  : Dec 07 2015
Time  : 22:32:04
Host  : "node7"
PID    : 123291
Case  : /home/OF/Base_potential2
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Source: "/home/OF" "Baseline_2.224_potential"
Target: "/home/OF" "Baseline_2.224_potential2"

Create databases as time
Case  : /home/OF/Base_potential
nProcs : 1

Source time: 0
Target time: 0

Create meshes

Source mesh size: 16487628      Target mesh size: 16487628


Consistently creating and mapping fields for time 0

Creating mesh-to-mesh addressing for region0 and region0 regions using cellVolumeWeight

Also running
Quote:

mapFields /home/OF/Base_potential -consistent
gives the same results.

Is there something wrong?
Thanks,
WhiteW

alexeym December 8, 2015 15:32

Hi,

Unfortunately I do not have OpenFOAM 2.3.0, yet I have 2.3.x and if I use pitzDaily potentialFoam's tutorial example and then pitzDaily case from rhoPimpleFoam/les, output is as follows (pf is folder with potentialFoam case):

Code:

daphne:pitzDaily$ pwd
$FOAM_RUN/pitzDaily
daphne:pitzDaily$ mapFields -fields '(U)' ../pf
...
Source mesh size: 12225        Target mesh size: 12225


Creating and mapping fields for time 0

Creating mesh-to-mesh addressing for region0 and region0 regions using cellVolumeWeight
    Overlap volume: 1.4516e-05
    interpolating U

End

And velocity field in pitzDaily is equal to pf case. I even can drop -fields flag, there is not much to map from potentialFoam.

Could you describe exact steps to reproduce your error? Maybe provide case folder archives.


All times are GMT -4. The time now is 07:39.