# Creating a New U_a, U_b

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

 May 15, 2013, 06:26 Creating a New U_a, U_b #1 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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.

 May 15, 2013, 08:12 #2 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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

 May 15, 2013, 13:29 Hmm #3 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 16, 2013, 08:56 Hi #4 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 16, 2013, 09:13 #5 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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

 May 16, 2013, 09:22 Hi #6 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 16, 2013, 09:36 #7 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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

 May 16, 2013, 09:41 #8 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 21, 2013, 07:09 #9 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 21, 2013, 07:20 #10 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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

May 21, 2013, 08:15
Hi
#11
Member

Rohith
Join Date: Oct 2012
Location: Bayreuth, Germany
Posts: 52
Rep Power: 5
Here is the file for singlephase transport and the solver file where i was trying to compute two mometum equations.

Thanks
rohith
Attached Files
 createFieldsa.H (2.2 KB, 5 views) my_porousSimpleFoam.C (2.5 KB, 4 views)

 May 21, 2013, 09:36 #12 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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 turbulencea ( incompressible::RASModel::New(Ua, phia, laminarTransporta) ); autoPtr 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

 May 21, 2013, 10:26 #13 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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

 May 21, 2013, 11:16 #14 Senior Member   Lieven Join Date: Dec 2011 Location: Mol, Belgium Posts: 295 Rep Power: 13 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

 May 21, 2013, 11:31 #15 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 Ya i found it.... But there are still new problems arising, Thanks a lot lieven rohith

 May 24, 2013, 08:53 #16 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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 > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C:(.text+0x18ad): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C:(.text+0x274d): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C:(.text+0x28ed): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C:(.text+0x32a6): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix >&) const' my_porousSimpleFoam.C:(.text+0x336e): undefined reference to `Foam::porousZone::addResistanceb(Foam::fvMatrix >&) const' my_porousSimpleFoam.C:(.text+0x4fe6): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix >&) const' my_porousSimpleFoam.C:(.text+0x50a6): undefined reference to `Foam::porousZone::addResistancea(Foam::fvMatrix >&) 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

 May 28, 2013, 07:01 Hi #17 Member   Rohith Join Date: Oct 2012 Location: Bayreuth, Germany Posts: 52 Rep Power: 5 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 > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C.text+0x18ad): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C.text+0x274d): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C.text+0x28ed): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix > const&, Foam::GeometricField, Foam::fvPatchField, Foam::volMesh>&, bool) const' my_porousSimpleFoam.C.text+0x32a6): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix >&) const' my_porousSimpleFoam.C.text+0x336e): undefined reference to `Foam:orousZone::addResistanceb(Foam::fvMatrix >&) const' my_porousSimpleFoam.C.text+0x4fe6): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix >&) const' my_porousSimpleFoam.C.text+0x50a6): undefined reference to `Foam:orousZone::addResistancea(Foam::fvMatrix >&) 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

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Joscha OpenFOAM Native Meshers: blockMesh 27 November 3, 2015 12:27 simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20 Tarak OpenFOAM 6 September 9, 2011 17:51 Emmanuel Resch CD-adapco 1 July 30, 2007 03:02 mer Main CFD Forum 2 November 12, 2005 09:50

All times are GMT -4. The time now is 08:29.