|
[Sponsors] |
Error occurred when compiling new application based on chtMultiRegionSimpleFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 15, 2013, 05:09 |
|
#1 |
Member
Kumudu
Join Date: Oct 2013
Posts: 63
Rep Power: 12 |
Hi,
I have changed the chtMultiRegionSimpleFoam, since I wanted to solve heat conduction equation for solid and scalar transport equation for fluid. These are the files that I changed, 1. createFluidFields.H 2.readFluidMultiRegionSimpleControl.H 3.setRegionFluidFields.H 4.solveFluid.H 5.chtMultiRegionSimpleFoam.C Note:I changed .H files related to solid as well As I wanted to have constant solid and water properties throughout the simulation, I defined rho, cp and K as constant dimensionedScalar for both solid and water. When I am compiling I got one error along with series of notes. I have attached all the .H files and error message. Please someone can explain how to correct this error and what does these notes means? Main error was : make: *** [Make/linux64GccDPOpt/MultiRegionScalarTransportFoam.o] Error 1 --------------------- I have changed the chtMultiRegionSimpleFoam, and compile it as MultiRegionScalarTransportFoam. I got this error with series of notes. Please some one tell me what is this error means. I am stuck in my thesis. I just want to know what is this error means. Main error was : make: *** [Make/linux64GccDPOpt/MultiRegionScalarTransportFoam.o] Error 1 Please someone can explain how to correct this error and what does these notes means? I am really stuck in my thesis. No one really helps me. Kumudu Last edited by wyldckat; December 26, 2013 at 12:06. Reason: So much information, have to collate it all into one post |
|
December 26, 2013, 13:23 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Hi Kumudu,
You should have mentioned that you are using OpenFOAM 2.1.1 And I think you tried to do too many changes in a single step. I suggest that instead of trying to do so many modifications in a single go, and given that you want fixed properties for both solid and fluid, use the solver chtMultiRegionSimpleFoam as a base for your custom solver. I say this because this solver is designed for incompressible flow, which is apparently what you want. Now, since you can use chtMultiRegionSimpleFoam as a basis for your solver, this means that you only need to add the scalar transport equation to the fluid side, which should be very similar (and easier) to the instructions given here: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam Once you've done these steps, let me know if you still have problems compiling your customized solver! By the way, before compressing the folder of the source code of your solver, run this command inside that folder: Code:
wclean all Best regards, Bruno
__________________
|
|
December 26, 2013, 13:52 |
|
#3 | |
Member
Kumudu
Join Date: Oct 2013
Posts: 63
Rep Power: 12 |
Quote:
1.I used the chtMultiRegionSimpleFoam as the base case.But,I thought as I need to solve only the energy equation for both solid and liquid (Diffusion for solid, scalar transport for the water), I have to remove all the equations that related to the P, U,h. Thats why I created the solve.H for fluid as this. Code:
{ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix TEqn ( fvm::ddt(rho*Cp, T) + fvm::div(rho*Cp*phi, T) == fvm::laplacian(K, T) ); TEqn.relax(); TEqn.solve(); } Info<< "Min/max T:" << min(T).value << ' ' << max(T).value << endl; } Code:
// Initialise fluid field pointer lists PtrList<volScalarField> TFluid(fluidRegions.size()); PtrList<volVectorField> UFluid(fluidRegions.size()); PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); PtrList<dimensionedScalar> rho(fluidRegions.size()); PtrList<dimensionedScalar> Cp(fluidRegions.size()); PtrList<dimensionedScalar> K(fluidRegions.size()); //****************************************************************** Info<< "Reading field variables and transport properties\n" << endl; //***************************************************************** // ********************************************************************** // Fluid field variables // ********************************************************************** Info<< "Reading Fluid field variables\n" << endl; forAll(fluidRegions, i) { Info<< " Adding fluid Temperature to feild\n" << endl; TFluid.set ( i, new volScalarField ( IOobject ( "T", runTime.timeName(), fluidRegions[i], IOobject::MUST_READ, IOobject::AUTO_WRITE ), fluidRegions[i] ) ); Info<< " Adding fluid velocity field\n" << endl; UFluid.set ( i, new volVectorField ( IOobject ( "U", runTime.timeName(), fluidRegions[i], IOobject::MUST_READ, IOobject::AUTO_WRITE ), fluidRegions[i] ) ); Info<< " Adding phi field to fluid through calculating fluid face flux field\n" << endl; phiFluid.set ( i, new surfaceScalarField ( IOobject ( "phi", runTime.timeName(), fluidRegions[i], IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), linearInterpolate(U) & mesh.Sf() ) ); // ********************************************************************** // Fluid transport properties // ********************************************************************** Info<< " Adding transport properties to fluid field\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), fluidRegions[i], IOobject::MUST_READ, IOobject::NO_WRITE ), fluidRegions[i] ); Info<< "\tReading fluid density\n" << endl; rho.set ( i, new dimensionedScalar ( fluidRegions[i].transportProperties.lookup("rho") ) ); Info<< "\tReading fluid specific heat\n" << endl; Cp.set ( i, new dimensionedScalar ( fluidRegions[i].transportProperties.lookup("Cp") ) ); Info<< "\tReading fluid thermal conductivity\n" << endl; K.set ( i, new dimensionedScalar ( fluidRegions[i].transportProperties.lookup("K") ) ); } Thats how I really learned to compile a new solver and add object as transport properties. Do you think what I did at the above is wrong? Do you think if I keep the things same and just add the scalar transport to the solver, keep other PEqn.H,hEqn.H and UEqn.H? Thanks again, Kumudu Last edited by wyldckat; December 26, 2013 at 14:54. Reason: Added [CODE][/CODE] |
||
December 26, 2013, 14:59 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Quote:
I ask this because it feels that you can simply define the water inside the pipe as if it were a solid as well!? |
||
December 26, 2013, 17:21 |
|
#5 | ||
Member
Kumudu
Join Date: Oct 2013
Posts: 63
Rep Power: 12 |
Quote:
Quote:
Thanks again. I have actually read MRConjugateHeatTransferFoam.C and chtMuitiRegionFoam.C. Because, I don't really need to solve pressure, and velosity. Just the temperature. And I need to keep constant solid and liquid thermo physical properties (K,Cp,rho). Thats why I create almost new cretaeFluidFields.H and cretaeSolidFields.H I cannot really understand what is the wrong with the code I prepared. I prepared a new tutorial case for that. I am attaching it too. Then, you will realize what exactly I wanted to do. But, I think velocity, boundary conditions will be wrong in the tutorial I prepared. Because, as I said before, I still doesn't know after creating one fluid zone using topoSetDict, how to give boundary conditions defining inlet, outlet and wall boundaries for the liquid by merging blocks in the blockMeshDict. Thats why created three different regions for liquid and connected them through boundary conditions. If you can tell me what is the wrong with code, I really appreciate it. But, I think I have bothered you so much. Best, Kumudu |
|||
December 28, 2013, 16:09 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Hi Kumudu,
If I understand you correctly, what you want is to create a multi-region solver that uses two basic solvers that OpenFOAM has got, namely:
The reason why I'm not able to simply state what the problem is with your solver, is because too many changes were made and it would take too long to diagnose all of the problems. The best approach, from what I can figure out from your description, is either one of the following possibilities:
Best regards, Bruno
__________________
|
|
December 28, 2013, 17:43 |
|
#7 | |
Member
Kumudu
Join Date: Oct 2013
Posts: 63
Rep Power: 12 |
Hi Bruno,
I really don't know how to thank you in words. But, I say many many thanks to you. Quote:
I just need to find out when the fluid (water) circulate through the pipe which is buried in the ground, what will be the fluid temperature at outlet of the pipe. So, my fluid( water) is an incompressible fluid and has constant Cp, rho and K. The mass flow rate of the pipe is constant. Solid also has constant thermal properties. The following are the equation that I should solve exactly, for fluid, ddt(rho_f*Cp_f, T_f)+ div(rho_f*Cp_f*phi, T_f)-laplacian(K_f, T_f)==Heat source_1 Heat source_1 = h*P(T_p - T_f) where, h is the convection heat transfer coefficient T_p = is the temperature at the inner surface of the pipe T_f =fluid temperature P=4/d_in d_in= inner diameter of the pipe I am writing the same in terms of PDE, if I made any thing wrong up there, { rho*Cp*∂T/∂t + rho*Cp*U*(∂T/∂z)-∂/∂x*(K*∂T/∂x)-∂/∂y*(K*∂T/∂y)- ∂/∂x*(K*∂T/∂x)= S_1 } Assume that, I will know only rho, Cp, U, and temperature of water at the inlet. Inlet temperature at the heating mode will usually be low as 5 (0_C). The ground will have maximum 20 (0_C) For pipe, ddt(rho_P*Cp_P, T_p) -laplacian(K_P, T_P)==Heat source_2 Heat source_2=h*(T_f - T_p)/ thickness_of_pipe For soil, ddt(rho_s*Cp_s, T_s) -laplacian(K_s, T_s)=0 These, all equations should be solved as considering the transient state. I have to simulate the outlet temperature of the pipe and ground temperature at the same time. Also, need to calculate convective resistance inside the pipe, conduction resistance of the pipe and grout (lets say this is soil) I also should be able to make the following changes , 1. the flowrate of the fluid should be constant up to 12 hours (flow is circulating) 2. Then stops running the flow in the next 12 hours No need to find pressure (actually, I wouldn't know the pressure conditions, and this is incompressible) No need to solve U equation, The velocity is constant Only field should be solved is the temperature. So, solving unnecessary fields makes my thesis more complex. Thats why I thought to solve laplacianFoam for solid, scalar transport equations for fluid. The heat sources are the boundary conditions at the interfaces, ı think so So, thats why I create the solver so simple. So, what would you suggest? How to overcome the error in the code? Thanks again. Best regards, Kumudu |
||
December 30, 2013, 15:17 |
|
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Hi Kumudu,
I honestly would like to create a simple basic multi-region solver, since it's a simple challenge and would get me a bit more understanding of how multi-region solvers work. But right now I apparently don't enough time to get to every single problem within this single vacation week So my suggestion is this: take one step at a time. Don't try to implement everything in a single go. I suggest that you first follow these steps:
In addition, always keep a safe copy of each step you do, so that you can trace back what you've done, as well as making it easier for others to help you, if they have access to the previous 1 or 2 steps, as well as the current step! Best regards, Bruno
__________________
|
|
December 30, 2013, 16:38 |
|
#9 | |
Member
Kumudu
Join Date: Oct 2013
Posts: 63
Rep Power: 12 |
Quote:
Because, in the blockCoupledScalarTransportFoam it was designed to used only one fluid and one solid region. But I need to have more regions in my case. If you have seen that the extended version which uses topoSet to define regions, please let me know. But, meanwhile I am using chtMultiRegionFoam and the similar case as multiRegionLiquidHeater. What would you think if I use chtMultiRegionFoam to solve the same problem which is to simply solve the temperature field of a solid and water flow with constant mass flow rate with a forced convection. If anything that I have to change in the given tutorial case of multiRegionLiquidHeater, what would you suggest? Thanks again. Happy new year and happy holiday!!!!!!!!!! Best Kumudu |
||
December 30, 2013, 17:16 |
|
#10 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
Honestly, it all really depends on the accuracy of the solution you are looking for and the time you are willing to let the solver run. The chtMultiRegion*Foam solvers are more than able to solve your simulations, as long as you properly configure the case. As I wrote above, have a look at that thread. 2013 isn't over yet But anyway: Happy holidays and have a good exit of 2013 and better entry in 2014
__________________
|
|||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
Is Playstation 3 cluster suitable for CFD work | hsieh | OpenFOAM | 9 | August 16, 2015 15:53 |
Compiling an application with OpenFOAM-1.6-ext ubuntu binaries | ZKM | OpenFOAM Running, Solving & CFD | 4 | March 24, 2014 07:05 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
incorrect temperature in pressure based solution | Kian | FLUENT | 1 | July 6, 2009 06:59 |