CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Creating a New U_a, U_b

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 15, 2013, 06:26
Default Creating a New U_a, U_b
  #1
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi ,

Is it possible to implement new variable for example Ua, Ub in the place of U and change all the necessary .h header files in accordance with the new change velocity names Ua and Ub. I have seen such in multiphase flow but i am not intersted in it. It is to solve two flow with two momentum equations in a system(mesh).

Last edited by RaghavendraRohith; May 15, 2013 at 07:22.
RaghavendraRohith is offline   Reply With Quote

Old   May 15, 2013, 08:12
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
Hi Rohith and welcome to the forum ;-)

I don't fully understand the question you're asking cause the answer is a bit in it. Yes it is possible to solve for Ua and Ub simply if you change everything accordingly as you suggest yourself.

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 15, 2013, 13:29
Default Hmm
  #3
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi Mr.Leiven


The problem actually is i need to solve two momentum and two impulse equations in a system with two different fluids(liq1 and liq 2) and thier physical properties. There is no contact between the fluids in mesh and in reality.

Where the case i described before is a multiphase or a dispersed phase flow where the Ua and Ub are balanced by a volume fraction in U. My intention is to solve

1. Ua,pa ----mometum equation1.
2. ub, pb --- mom. eq 2

In this case i need to create two U and p files in the boundary conditions(0) file and two different schemes. And everything is doubled..


Thanks in Advance
Rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 16, 2013, 08:56
Default Hi
  #4
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi

My intention is to change the declaration of variable U in the roots of the code with other name U_a and p with p_a .


Can somebody state where the declaration of the initial file for U and p are present. Declaration means declaration of U and p as some character.

i can declare U a and p a in the same file, in the way u and p are declared.

They are linked with almost all the million files in OpenFOAM. i wanted to use a logic to handle them for my CFD problem

Regards
rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 16, 2013, 09:13
Default
  #5
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
Hi Rohith,


I'm still trying to understand what you want to achieve. If the fluids are not in contact with each other. Why wouldn't you simply run two independent simulations?

The name of the files is usually set in "createFields.H" of the solver. Search for IOobject("U", ...) and change it to IOobject("U_a",...) . Changing the name of the variable U to U_a is also possible and the only files you need to change for that are the files of the solver. But again, why not running 2 simulations?

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 16, 2013, 09:22
Default Hi
  #6
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
I have done the above case but lot of files like

fvCFD.H,single transport.H, etc., all know only U and p.

This problem goes to the editing the root files


The main issue is the two fluids are not in contact but there is 4 electron transfer between them. The main issue here is the flow of these two fluids is perpendicular to each other ,but they are not in contact.

OpenFOAM just knows that U = Velocity
p = pressure


But in my problem i will not solve one navier stokes equation. I will solve two momentum equations at a time along with two continituty eqns.

kind of tricky but necessary

Thanks
Rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 16, 2013, 09:36
Default
  #7
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
Ok, I'm starting to understand it. So they are not in direct contact with each other but they do influence each other.

Before starting to mess around in the code, you should update your knowledge on object oriented programming a bit. The names of objects in other classes is not related to the names used in the solver itself. For consistency, velocity is usually called U etc. but this is basically a convention. E.g. if you create a 'singlePhaseTransportModel'-object
Code:
singlePhaseTransportModel laminarTransport(U, phi);
or you do it like
Code:
singlePhaseTransportModel laminarTransport(U_a, phi);
the code of the singlePhaseTransportModel-class does not need to change at all, it can still refer to the velocity as 'U'.

I hope this helps you a bit.

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 16, 2013, 09:41
Default
  #8
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
So you mean the definition links it to the desired path and the solver automatically. Ok then

Can i use two U_a and U_b by using a recurssive loop in any data file.? eg : createporousZones or create fields or in solver.C file?

in each file.?

Thanks

Rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 21, 2013, 07:09
Default
  #9
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi L

I tried to eradicate all the errors but the problem in compiling a solver which solves two momentum and two continuity equations is still there. I tried to compile it but the major problem comes with calling singlePhaseTransportModel again and again. As in my case the flow is individually single phase even if there are two fluids.

I can send you the file if needed.

thanks
rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 21, 2013, 07:20
Default
  #10
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
Hi Rohith,


Feel free to post the code here or to send it to me in private. Whatever you like. I'll have a look at it at my earliest convenience.

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 21, 2013, 08:15
Default Hi
  #11
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Here is the file for singlephase transport and the solver file where i was trying to compute two mometum equations.


Thanks
rohith
Attached Files
File Type: h createFieldsa.H (2.2 KB, 5 views)
File Type: c my_porousSimpleFoam.C (2.5 KB, 4 views)
RaghavendraRohith is offline   Reply With Quote

Old   May 21, 2013, 09:36
Default
  #12
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
Hi Rohith,


I'm a bit confused with your "#include "singlePhaseTransportModela.H"" statements. Why not use
Code:
#include "singlePhaseTransportModel.H"
in my_porousSimpleFoam.C

and define
Code:
singlePhaseTransportModel laminarTransporta(Ua, phia);
singlePhaseTransportModel laminarTransportb(Ub, phib);
which in its turn you should use in
Code:
autoPtr<incompressible::RASModel> turbulencea
(
    incompressible::RASModel::New(Ua, phia, laminarTransporta)
);
autoPtr<incompressible::RASModel> turbulenceb
(
    incompressible::RASModel::New(Ub, phib, laminarTransportb)
);
Make sure you also have defined "createPhia.H" and "createPhib.H" yourself cause else you will also get an error on these files.

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 21, 2013, 10:26
Default
  #13
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi Lieven

I have tried it before but the execution of the file is done but it shows iofatal error when the run the problem by using the compiled solver


"ill defined primitiveEntry starting at keyword 'value' on line 52 and ending at line 69

Which drives the problem to primitve entry io.h file

i am looking through the problem give me asuggestion if you have an idea to solve this.


Your suggestions were really helpful.

Thanks a lot

rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 21, 2013, 11:16
Default
  #14
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 14
Lieven will become famous soon enough
This error is not related to the solver. It is probably due to a boundary condition that is missing a 'value' entry or where the 'value' entry is incorrectly defined.

Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   May 21, 2013, 11:31
Default
  #15
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Ya i found it....

But there are still new problems arising,

Thanks a lot lieven

rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 24, 2013, 08:53
Default
  #16
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi leiven


Code:
leFoam
Make/linux64GccDPOpt/my_porousSimpleFoam.o: In function `main':
my_porousSimpleFoam.C:(.text+0x17dd): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix<Foam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C:(.text+0x18ad): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix<Foam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C:(.text+0x274d): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix<Foam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C:(.text+0x28ed): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix<Foam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C:(.text+0x32a6): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix<Foam::Vector<double> >&) const'
my_porousSimpleFoam.C:(.text+0x336e): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix<Foam::Vector<double> >&) const'
my_porousSimpleFoam.C:(.text+0x4fe6): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix<Foam::Vector<double> >&) const'
my_porousSimpleFoam.C:(.text+0x50a6): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix<Foam::Vector<double> >&) const'
collect2: ld gab 1 als Ende-Status zurück
make: *** [/home/kasibhat/OpenFOAM/kasibhat-2.1.1/platforms/linux64GccDPOpt/bin/my_porousSimpleFoam] Fehler 1
I have tried to eliminate all the errors in my solver and make it work. but what is this , how can i solve this


thanks

rohith
RaghavendraRohith is offline   Reply With Quote

Old   May 28, 2013, 07:01
Default Hi
  #17
Member
 
Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 53
Rep Power: 5
RaghavendraRohith is on a distinguished road
Hi Leiven

The same below problem appears after including all files in options file and copying all files in the appropriate folders





[CODE]

leFoam
Make/linux64GccDPOpt/my_porousSimpleFoam.o: In function `main':
my_porousSimpleFoam.C.text+0x17dd): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix<F oam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C.text+0x18ad): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix<F oam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C.text+0x274d): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix<F oam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C.text+0x28ed): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix<F oam::Vector<double> > const&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, bool) const'
my_porousSimpleFoam.C.text+0x32a6): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix<F oam::Vector<double> >&) const'
my_porousSimpleFoam.C.text+0x336e): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix<F oam::Vector<double> >&) const'
my_porousSimpleFoam.C.text+0x4fe6): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix<F oam::Vector<double> >&) const'
my_porousSimpleFoam.C.text+0x50a6): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix<F oam::Vector<double> >&) const'
collect2: ld gab 1 als Ende-Status zurück
make: *** [/home/kasibhat/OpenFOAM/kasibhat-2.1.1/platforms/linux64GccDPOpt/bin/my_porousSimpleFoam] Fehler 1
/CODE]

thanks

rohith
RaghavendraRohith is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems in creating a wedge type mesh Joscha OpenFOAM Native Meshers: blockMesh 27 November 3, 2015 12:27
Fluent3DMeshToFoam simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Problems with Meshing: Collapsed Cells Emmanuel Resch CD-adapco 1 July 30, 2007 03:02
Gerris software installation mer Main CFD Forum 2 November 12, 2005 09:50


All times are GMT -4. The time now is 09:40.