|
[Sponsors] |
July 17, 2015, 08:29 |
Error for User defined Variables
|
#1 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi,
I have tried to create a new solver darcyFoam . But I am facing error saying that /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/zeroI.H:72:13: note: template argumen t deduction/substitution failed: darcyFoam.C:64:24: note: cannot convert ‘Foam:perator*(const Foam::dimensioned<double>& , const Foam::dimensioned<Type>&) [with Type = double]((*(const Foam::dimensioned<double>*) (& mu)))’ (type ‘Foam::dimensioned<double>’) to type ‘const Foam::zero&’ k = -U*mu/fvc::grad(p) ; ^ darcyFoam.dep:531: die Regel für Ziel „Make/cygwin64mingw-w64DPOpt/darcyFoam.o“ scheiterte make: *** [Make/cygwin64mingw-w64DPOpt/darcyFoam.o] Fehler 1 Could you please help me? Regards. |
|
July 17, 2015, 09:21 |
|
#2 |
Senior Member
|
Hi,
Could you post a few lines of context? How k is defined for example? Also, what is wrong with pimpleFoam (or simpleFoam in case of steady-state problems) + explicitPorositySource? I.e. why do you need to create darcyFoam? |
|
July 17, 2015, 09:42 |
|
#3 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi thanks for your reply.
Actually I need to create a solver for transient flow with porous media . I am new to OpenFoam so I was just learning how to create user defined variables. I need to put the formula for permeability from Darcy's law which is: k=U*mu/delta(p) I don't know how to put it in the .C file . I have typed the following but I get an error. k = -U*mu/grad(p) error: /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvcGrad.C:159:1: note: ‘Foam::fvc::grad’ grad What do I do? Also can you suggest me which slover I should begin with for my case (transient,incompressible,laminar,porous flow)? With regards. |
|
July 17, 2015, 09:49 |
|
#4 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Sorry I typed the wrong formula
Formula: k = -U*mu/fvc::grad(p) error: /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/zeroI.H:72:13: note: template argument deduction/substitution failed: darcyFoam.C:64:24: note: cannot convert ‘Foam:perator*(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&, const Foam::dimensioned<double>&) [with Type = Foam::Vector<double>; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]((*(const Foam::dimensioned<double>*)(& mu)))’ (type ‘Foam::tmp<Foam::GeometricField<Foam::Vector<doubl e>, Foam::fvPatchField, Foam::volMesh> >’) to type ‘const Foam::zero&’ k = -U*mu/fvc::grad(p) ; ^ darcyFoam.dep:531: die Regel für Ziel „Make/cygwin64mingw-w64DPOpt/darcyFoam.o“ scheiterte make: *** [Make/cygwin64mingw-w64DPOpt/darcyFoam.o] Fehler 1 |
|
July 17, 2015, 10:25 |
|
#5 |
Senior Member
|
Hi,
I guess darcyFoam.C was derived from certain standard solver, which solver did you use? Also I will repeat question from last message: how do you declare variable k? Particularly what is the type of k? Also in general you calculate gradient of pressure caused by porosity from velocity and permeability, not vice versa. If you need to simulate transient incompressible laminar flow through porous media, I would suggest you pimpleFoam solver. Since it is quite general, you have to specify "simulationType laminar" in constant/turbulenceProperties to exclude calculation of turbulence. To add drag term in momentum equation, you should use explicitPorositySource (see src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H for explanation or tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions for example). To estimate Darcy-Forchheimer coefficients you can use Kozeny-Carman or Ergun equations (or any other relations if they describe behaviour of your porous media better). |
|
July 17, 2015, 10:33 |
|
#6 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi Thanks a lot
k is the permeability which I need as an output variable. I will follow your instructions and try using the pimpleFoam solver. But in that also I will have to put the equation for permeability. So what should I do then? |
|
July 17, 2015, 12:44 |
|
#7 |
Senior Member
|
Hi,
pimpleFoam + fvOption solution assumes constant permeability. So you take piece of paper, pen/pencil, Kozeny-Carman formula and calculate permeability If you need varying permeability (or better to say porosity), you can create your own fvOption. But since you still did not manage to answer the question about variable k, guess, it will not be easy. |
|
July 21, 2015, 05:41 |
|
#8 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi
Yes my case is for anispotropic permeability. For that do I also need to set the Create Zones file (like is there for rhoPimpleFoam) ? Thanks a lot for your help. |
|
July 21, 2015, 10:00 |
|
#9 |
Senior Member
|
Hi,
There is no connection between anisotropy and cell zones. You need cell zone if your porous area is only part of the mesh. For anisotropy you have d and f as vectors (if you choose Darcy-Forchheimer model) and rotation of coordinate system set by e1 and e2 vectors (you can find equations used to transform vectors d and f into tensors D and F in $FOAM_SRC/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C). |
|
July 21, 2015, 10:08 |
|
#10 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hello,
Could you please tell me how do I solve a porous media problem (Darcy Forschheimer equation) here. Also how do I set Permeability as the output? As per my knowledge permeability K=1/d (darcy's constant) How do I define this as my output variable? |
|
July 21, 2015, 11:14 |
|
#11 |
Senior Member
|
Hi,
Unfortunately I do not understand what is blocking you for running pimpleFoam (with fvOptions set up using tutorial example). I have posted all keywords and necessary files to get you started. |
|
July 21, 2015, 11:24 |
|
#12 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi,
Yes I have understood completely what you have explained. The only problem I have right now is that I want to view the results in terms of anisotropic permeability . For that I do not know yet how to define the user defined variable for permeability (K). Thanks again for your help |
|
July 21, 2015, 13:42 |
|
#13 |
Senior Member
|
Hi,
Since
I will withdraw myself from conversation. |
|
August 5, 2015, 04:12 |
|
#14 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Hi,
I have a question regarding the effects of fiber angle orientation now.Can you please tell me how to consider the fibre orientation while solving a case for porousInterFoam from the tutorials? For example with fibre angle of 0 degrees. Thanks in advance! regards. |
|
August 5, 2015, 05:27 |
|
#15 |
Senior Member
|
Hi,
You have global coordinate system, you have local coordinate system of porous area, that is defined in DarcyForchheimerCoeffs: Code:
DarcyForchheimerCoeffs { ... coordinateSystem { type cartesian; origin (0 0 0); coordinateRotation { type axesRotation; e1 (0.70710678 0.70710678 0); e2 (0 0 1); } } } The answer is just a guess, cause question does not contain any context about "fibre". |
|
August 5, 2015, 05:33 |
|
#16 |
New Member
as
Join Date: Jul 2015
Posts: 19
Rep Power: 11 |
Thanks a lot for your reply.
I meant was for the following details how to program the solver file . layer 1 fiberVolFraction 0.55 fiberAngle 0 layer 2 fiberVolFraction 0.55 fiberAngle 90 So for this case how to write the file ? Do I also need to modify the solver PorousInterFoam to consider the effects of fiber angle? Regards! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ADDITIONAL VARIABLES LIMITERS | N.P | CFX | 5 | December 1, 2011 08:47 |
$FOAM_USER_APPBIN & LIBBIN variables not set | rassilon | OpenFOAM Installation | 2 | February 16, 2010 21:54 |
User Defined Scalars - Returning Values | Carlos V. | FLUENT | 0 | April 19, 2006 19:18 |
PHI file structure | Eugene | Phoenics | 9 | November 2, 2001 23:00 |
Saving variables on a user patch with physical coordinates | Zoltan Turzo | CFX | 2 | April 20, 2000 16:05 |