CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   mapping of pressure field (simplefoam to cavitatingFoam) (http://www.cfd-online.com/Forums/openfoam-solving/84981-mapping-pressure-field-simplefoam-cavitatingfoam.html)

siddharameshwara February 14, 2011 10:58

mapping of pressure field (simplefoam to cavitatingFoam)
 
Hello to all,

I would like to map the pressure field of simpleFoam to cavitatingFoam. There is difference in pressue field of simpleFoam(it is in m2/s2 units) and cavitatingFoam( it is in kg/m/s2). There is difference between them by factor of density of fluid i am using. For that i have a file. I just found it in internet. Could any one tell me how to use it???


Thanks in advance.

mvoss February 15, 2011 03:55

how can anybody know what you found "in the internet".
What kind of packages/data do you get after unpacking the file?

siddharameshwara February 15, 2011 04:05

Hi,

I am new to this openFoam. So i didnt posted in a right way.:( It contains Make directory with 'files and options' files in it. and also convertPhi.C file. So i dont know how i can use it so that i can map(pressure field) from simpleFoam result to cavitatingFoam.

Or...is there any way to map the fields??

kindly suggest me.

Thanks

mvoss February 15, 2011 04:14

try to run wclean and a wmake in that directory. that will give you a library convertingPhi.lo which you can run from within your cavitatingFoam dir after maping your simpleFoam results.
Why donīt you just copy the 0/p-U-... files (convert them properly) from simpleFoam and run cavitatingFoam? But mapping is also fine....

neewbie

siddharameshwara February 15, 2011 05:47

Hello,

Thank you very much for the quick response. I tried the way you told me. I tried to make dynamic linking by typing the command wmake libso. It displayed the following message.

'libNULL.so' is up to date

So now if i want to use it how i can use???...how this could be used to map the results

i am sorry if this question is silly.

Thanks in advance..

mvoss February 15, 2011 05:49

why wmake libso?
Can you post a download?

siddharameshwara February 15, 2011 06:07

Hello,

When i looked in my documents i have found wmake libso would be best one. So, that it will have dynamic linking. I think it doesnt matter if it is static or dynamic link. Correct me if i am wrong!!

You can find in my attachments convertPhi.C file

I cant upload file and options. I have some problem.

In the Make--> file its written

convertPhi.C

EXE = $(FOAM_APPBIN)/convertPhi


and in make--> options its written

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lfiniteVolume

mvoss February 15, 2011 06:16

change
convertPhi.C
EXE = $(FOAM_APPBIN)/convertPhi
to
myconvertPhi.C
EXE = $(FOAM_USER_RAPPBIN)/myconvertPhi

change the .C file to myconvertPhi.C
wclean
wmake (not wmake libso)

run the tool in the copied file-structure of the simpleFoam run by typing
myconvertPhi

Make sure $FOAM_USER_APPBIN is set properly, check with
echo $FOAM_USER_APPBIN.

neewbie

siddharameshwara February 15, 2011 06:39

run the tool in the copied file-structure of the simpleFoam run by typing
myconvertPhi

Hi,

I didnt understand the above statement.

Firstly, i will get the solution by typing the command simpleFoam in my directory where i am solving problem. So, when i have to type this command myconvertPhi after getting the solution of simpleFoam or what?? i cant type the command myconvertPhi and simpleFoam at a time.

Secondly should i copy the files that i have send you in the directory where i have ia m running simpleFoam

Thirdly, How after running the simulation i can map it.


Please clear this. i am sorry if i am roubling you.

Thnaks

mvoss February 15, 2011 06:52

Quote:

Originally Posted by siddharameshwara (Post 295306)
Firstly, i will get the solution by typing the command simpleFoam in my directory where i am solving problem. So, when i have to type this command myconvertPhi after getting the solution of simpleFoam or what?? i cant type the command myconvertPhi and simpleFoam at a time.

1. compile the myconverPhi.C somewhere in a single folder by doing as stated above
if you succeed then you should be able to type "myco+[TAB]" and your system will auto-complete the rest for you; as the autofilling is working your system knows where to search for "myconvertPhi"($FOAM_USER_APPBIN) and the tool can at least be executed
2.create a case and run simpleFOAM
3.run myconvertPhi there after the simpleFOAM finished
4. map to your cavitatingFOAM directory
Quote:

Secondly should i copy the files that i have send you in the directory where i have ia m running simpleFoam
NO... see above 1.
Quote:

Thirdly, How after running the simulation i can map it.
(check out http://openfoamwiki.net/index.php/MapFields)

siddharameshwara February 15, 2011 07:03

Hi,

Thank you so much for the detail description. I will try it out the steps said by you.

siddharameshwara February 15, 2011 09:21

Hello,

I tried the steps said by you. But i am getting one error. I.e.

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6.x
Exec : myconvertPhi
Date : Feb 15 2011
Time : 14:12:37
Host : rbgv119x
PID : 4674
Case : /appl/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/fields/fvPatchFields/derived/myconvertPhi
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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


--> FOAM FATAL ERROR:
:mad:Missing reference density:mad:


From function myconvertPhi
in file myconvertPhi.C at line 43.

FOAM exiting



So where should i give this reference density??. in my case for simpleFoam solver no where i mentioned the density. I mentioned only kinematic viscocity in constant/transportProperties. So where can i give reference velocity or is there any other way???...Fluid is desel.

Thanks inadvance.

mvoss February 15, 2011 09:46

first of all: itīs not good idea to put stuff in /appl/OpenFOAM/OpenFOAM-1.6.x/src/~ ... put your personal stuff beside the OF installation but thatīs also a matter of taste.

rhoRef is a parameter for myconvertPhi

Code:

if (!args.options().found("rhoRef"))
    {
        FatalErrorIn(args.executable())
            << "Missing reference density"
            << endl;

        FatalError.exit();
    }

in myconvertPhi.C

argc=Number of Arguments
agrv=Argument

so try smth. like myconvertPhi 1000
1000 being your rhoRef.

siddharameshwara February 15, 2011 09:56

Hey,

Thank you so much. It worked out. I looked at my rhop new file everything is fine the values and all......wow:)...thanks a lot for all your messages. Have a g8 day!!!

mvoss February 15, 2011 09:59

u r welcome...


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