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/)
-   -   problems with surfaceScalaField (https://www.cfd-online.com/Forums/openfoam-solving/128112-problems-surfacescalafield.html)

sanjar January 3, 2014 15:14

problems with surfaceScalaField
 
Hello guys, i am working with DPMFoam based on the Goldschmidt Tutorial. Originally it has a manualInjection but i changed it into a patchInjetction.
After a few errors, which I was able to manage correctly I am realy fighting with the following problem:

Code:

--> FOAM FATAL ERROR:

    request for surfaceScalarField phi from objectRegistry region0 failed
    available objects of type surfaceScalarField are

3
(
alphaPhic
phic
alphacf
)

Obwiously it is looking for this variable phi in surfaceScalarField.
Actually i dont know how to handle this problem. I tried to change it in my boundary conditions:

Code:


oundaryField
{
    WALL
    {
        type          zeroGradient;
    }
    OUTLET
    {
        type          totalPressure;
    p0        uniform 0;
    U        U;
    psi        none;
    gamma        1;
    phi        phi;
    value        uniform 0;
    }
    EROSIONPLATE
    {
        type            zeroGradient;
    }
    INLET
    {
        type          zeroGradient;
    }
}


sanjar January 7, 2014 14:42

isn't there somebody who could help me...its a pretty serious issue.. :(

thank you guys!

klilla January 8, 2014 03:38

Dear Sanjar,

I do not know the solver you are using, but the error tells you what is the problem. It is looking for the flux field (phi) on the faces, called phi. Now, in your solver you do not have it, but only:

alphaPhic
phic
alphacf

by intuition, most probably phic is your flux, but that you know, I guess.

So what you need to do, instead of defining your flux as phi, change it to phic (or anything else your flux is defined as).

oundaryField
{
WALL
{
type zeroGradient;
}
OUTLET
{
type totalPressure;
p0 uniform 0;
U U;
psi none;
gamma 1;
phi phic;
value uniform 0;
}
EROSIONPLATE
{
type zeroGradient;
}
INLET
{
type zeroGradient;
}
}
I hope this is helping, best,
Lilla

sanjar January 8, 2014 06:42

Hey Lilla,

thank you very much for your response. I appreciate it very much.
To keep my answer short: I already changed my phi into phic and also into the other two types of my surfacescalarField.

But the error still exists. Thats why i am still on this post :)

Thank you at all!!!

Best regards, Sanjar

klilla January 8, 2014 07:53

I see. I went to your solvers code, here you define the pressure earlier in the createField.H file than the phic. So you actually do not yet have phic, while you already want to use it for your BC on p. My idea, is that you need to move the definition of phic between Uc and p.

But this is just a suggestion to try.

Best,
Lilla

sanjar January 8, 2014 08:02

Hi Lilla,

thank you for that advice. Actually i dont know what you really mean with "moving". Which steps would you recommend?

BTW: During our conversation here i updated my OF 2.2.x and started again my case with the updated Goldschmidt-tutorial. But is still did not work. (If there is somebody who ha salso the same problem)

Best, Sanjar

klilla January 8, 2014 08:07

Sorry, I was too short. So go to the source code of your solver and open the createFields.H file.

There you have the definition of Uc and p. After the p you have the definition of phic:


Info<< "Reading/calculating continuous-phase face flux field phic\n"
<< endl;


surfaceScalarField phic
(
IOobject
(
"phic",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(Uc) & mesh.Sf()
);

This is the part you need to cut and put between Uc and p definition.

Then save the file and re-compile the solver. I think it should be your problem.
Best,
Lilla

sanjar January 8, 2014 10:26

Is it that simple as it seems?
I cut and paste this between p and Uc in my boundary conditions.
But what to do with the values like :

IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE

How to handle these?
greetings sanjar

sanjar January 13, 2014 18:16

hello guys, this is a kind of an update as for the ones who are also struggling wih the solver DPMFoam.

Actually i am not an expert but i am lucky that i get advice and help from Lilla, whose help and person i appreciate very much.

so this is the very first step t get a solution for this problem or at least an adviced path, which is basically an answr of Lilla, and which should be provide for the OF-community:

My problem doesnt come from my BC at all. The problem is mre cause by the naming of the variables as UC and phic. So the source code of the DPMFoam solver was analysed and there was that kind of error.

now i am trying to compile it with the following description by Liila:


"First of all, everything I refer to is starting from the DPMFoam directory.

In my company, we have a general installation, so I inserted the _USER_ tag in the ./Make/files file

"EXE=$(FOAM_USER_APPBIN)/DPMFoam"

The same applies to ./dragModels/Make/files

"EXE=$(FOAM_USER_LIBBIN)/libDPMDragModels"

This last line already tells that the dragmodels are a library to link and not a utility or solver. In order to compile it you have to use the:

"wmake libso"

command. Try to compile it.

Now that you have this library, you need to link in. Open the ./Make/options file. You need to add 2 lines. Now, I do not know what exactly, if you have your own compilation, just the way we work here:

"EXE_INC = \
...
-I./dragModels/lnInclude"

"EXE_LIBS = \
...
-L$(FOAM_USER_LIBBIN)"

with that you should be able to compile the solver, without problem."

If there is somebody who is working on DPMFoam too...maybe we can exhange information ...especially for the success of everybdy who is working on it.

Thank you guys, thank you Lilla!

wyldckat January 26, 2014 13:59

Greetings to all!

@sanjar: I was trying to reproduce the problem you had originally reported on this thread, but I don't have enough information to work with. :( I was doing this because creating a variant of the solver doesn't seem to me to be the best option, but only a workaround.

If possible, can you please provide information on the changes necessary on the tutorial case, so that I can test this as well and can ascertain if there is a bug in OpenFOAM's DPMFoam or not?
The simplest would be for you to:
  1. Change the tutorial "lagrangian/DPMFoam/Goldschmidt" according to what you've done for your case, which reproduces the same reported problem.
  2. Then run foamCleanTutorials inside the modified folder.
  3. Then compress the folder into zip or tar.gz.
  4. Then attach the compressed file on your next post.
Best regards,
Bruno

sanjar January 27, 2014 19:01

hello bruno,

my file size exceeds the size in this forum.
can you give me your email adress. i will send it to you via email

I HAVE A BIG PROBLEM NOW!!!

after i executed the command foamCleanTutorials the terminal worked for a few minutes.i worked also in openfoam 2.2.0 and openfoam 2.2.2. which i had installed.
i was wondering about that and also worried. and my worries became true!!!!!!!

i executed another case with icoUnocupledKinematicPArcelFoam which is very important for me and which runs with openfoam2.2.2

after executing simpleFoam the terminal says:

Code:

sanjar@sanjar-Lenovo-U410:~/OpenFOAM/sanjar-2.2.0/run-1/SA/generic/Box_Turbulent_Stroemung$ simpleFoam
simpleFoam: error while loading shared libraries: libmpi.so.1: cannot open shared object file: No such file or directory

WTF???
nothing works anymore! and i need that for my thesis.

i know that i will have a sleepless night!! what should i do??

PLEASE HELP!!!!

chenxizh January 28, 2014 03:31

sanjar, the error tells you that something is wrong while loading the mpi library,
you may type :
which mpirun
to get if the mpi work well or not
if you used the openmpi in ThiryParty, you may need to go the Thirypary
dir and run ./Allwmake

Quote:

Originally Posted by sanjar (Post 472044)
hello bruno,

my file size exceeds the size in this forum.
can you give me your email adress. i will send it to you via email

I HAVE A BIG PROBLEM NOW!!!

after i executed the command foamCleanTutorials the terminal worked for a few minutes.i worked also in openfoam 2.2.0 and openfoam 2.2.2. which i had installed.
i was wondering about that and also worried. and my worries became true!!!!!!!

i executed another case with icoUnocupledKinematicPArcelFoam which is very important for me and which runs with openfoam2.2.2

after executing simpleFoam the terminal says:

Code:

sanjar@sanjar-Lenovo-U410:~/OpenFOAM/sanjar-2.2.0/run-1/SA/generic/Box_Turbulent_Stroemung$ simpleFoam
simpleFoam: error while loading shared libraries: libmpi.so.1: cannot open shared object file: No such file or directory

WTF???
nothing works anymore! and i need that for my thesis.

i know that i will have a sleepless night!! what should i do??

PLEASE HELP!!!!


sanjar January 28, 2014 03:39

everything is allright (again)

pici June 27, 2015 13:57

Again DPMFoam problem with RAS turbulence
 
1 Attachment(s)
Hi to everybody.
The problem initially reported by sanjar is again back.
Attached I send my example case: the DPMFoam/Goldschmidt tutorial modified to run with RAS turbulence model. As you can see in attached log file, I'm still continuing to receive the same error:

Code:

--> FOAM FATAL ERROR:
    request for surfaceScalarField phi from objectRegistry region0 failed
    available objects of type surfaceScalarField are
3
(
phi.air
alphaPhic
alphacf
)

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

I tried any kind of smart (and stupid) trick, but it doesn't work. I hope that it is only a mistake writing (U|k|epsilon|nut).air and p files on 0/ directory and/or fvshemes and fvsolution file in system/.

I'm using last openFOAM 2.4.0 release.
Thank a lot for any help
Piero

wyldckat August 20, 2015 15:07

1 Attachment(s)
Greetings Piero,

Sorry for the late reply, but only today did I finally manage to look into this.

Attached is the package "Goldschmidt_RAS_24x.tar.gz" that has the case adjusted to work with OpenFOAM 2.4.x. Took me several minutes to fix through all of the missing details.

The only difference for it to work with 2.4.0 is in the file "constant/transportProperties", where there is a typo in the code, which requires this adjustment:
Code:

- continuousPhaseName air;
+ contiuousPhaseName  air;

Best regards,
Bruno

pici August 21, 2015 06:09

Hi Bruno,
thank you very much for your suggestion. I'm just beginning a new job using oF 2.4.0 and it is a very useful hint .
It is very strange that it is possible to find this kind of error, but the code is made by 'humans', isn't?
Ciao
Piero


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