|
[Sponsors] |
Error: gradientInternalCoeffs cannot be called for a calculatedFvPatchField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 10, 2020, 04:18 |
Error: gradientInternalCoeffs cannot be called for a calculatedFvPatchField
|
#1 | |||
Senior Member
|
Hello Foamers,
In my work, I'm calculating pressure through the following equation, Quote:
Quote:
Anyone have some ideas as how to resolve the above error and proceed further. Thank you |
||||
January 10, 2020, 09:21 |
|
#2 | |||
Senior Member
|
I checked few threads again..
Unexplained Error - Based on the explanation in this thread, I add a new read constructor for p2 in createFields.H as, Quote:
Quote:
While running case file, there comes same error as: Quote:
Thank you |
||||
January 10, 2020, 10:01 |
|
#3 | |
Senior Member
|
I feel there is problem with the declaration of code - in an implicit squared term.
Quote:
volScalarField p2(sqr(p)); //based on volScalarField p |
||
January 10, 2020, 10:57 |
|
#4 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15 |
A couple of things I notice here, which may help.
1. You have a new variable p2 which you are defining as the square of p. Doing that may not set proper boundary conditions on p2. My guess is that the boundary conditions of p2 are being set to 'calculated', and thus you cannot solve an equation for p2. 2. You provide a constructor for p2 in another attempt, but the p2 file has 'calculated' boundaries. Since p2 is the variable you intend to use in the formulation, you need to figure out what boundary conditions make sense for it. Then initialize p2 accordingly. See if that helps. |
|
January 10, 2020, 11:39 |
|
#5 |
Senior Member
|
Thank you for your response Adjiraj.
p2 (square of pressure) used in my formulation. There is no specific boundary condition for variable p2 because it is just square of pressure. Then how to initialize p2 accordingly? Correct me if Im wrong please |
|
January 10, 2020, 14:18 |
|
#6 | |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15 |
Quote:
Once again, determine the appropriate initial conditions and boundary conditions from those of p. Hope this helps. |
||
January 11, 2020, 02:18 |
|
#7 | ||
Senior Member
|
Dear Adhiraj,
Thank you for your comments. As per your point, in order to solve the variable p2 in the equation, I should prescribe the appropriate initial and boundary condition for p2 based on the corresponding boundary p. Quote:
For pressure p, I have defined reasonable boundary conditions (below) Quote:
|
|||
January 11, 2020, 06:36 |
|
#8 |
Senior Member
|
In comment 2 of this thread, p2 is fitted with *calculated* boundary condition. I dont find anyother appropriate boundary condition will fit for p2.
Kindly share some ideas. Thank you |
|
January 11, 2020, 12:36 |
|
#9 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15 |
Yes, you need to derive the boundary conditions and initial conditions for a new variable.
For example, if at a particular boundary the boundary condition for p is 'fixedValue' with a value of 10, p2 at the boundary can be 'fixedValue', with a value of . Use the same process for other boundaries and the initial condition. The 'calculated' boundary condition is not really a true boundary condition that solvers can use. It is simply a placeholder. |
|
January 11, 2020, 22:40 |
Files attached !!
|
#10 | |
Senior Member
|
Dear Adhiraj,
Thank you for your comments. As you mentioned, I defined p2 boundary with 'fixedValue'. It ends up with same error. Quote:
|
||
January 12, 2020, 18:19 |
|
#11 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15 |
The error message seems to indicate that the code is still seeing p2 with 'calculated' boundary condition.
In your createFields.H file, why don't you initialize p2 like this? Code:
Info<< "Reading field square of p\n" << endl; volScalarField p2 ( IOobject ( "p2", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); |
|
January 12, 2020, 23:39 |
|
#12 |
Senior Member
|
Dear Adhiraj,
Thank you very much. It worked. Then, I guess - no need to solve p. I will solve p2 directly by taking the squared value. No more errors. |
|
January 12, 2020, 23:46 |
solving U and p
|
#13 |
Senior Member
|
Dear Adhiraj,
Irrespective of this thread caption, I have one more question. In my work, I need to resolve two variables U and p. As given in the attachment, I derived 2 equations for velocities to calculate Ux and Uy. Followed by the pressure equation to solve pressure. Firstly, once after resolving velocities along x and y, pressure will be solved. I defined the equations in OpenFOAM, gets compiled and the case runs without error. During post-processing, I dont find change in velocity inside my domain. However, the pressure (p2) variable is changed. Quite confused here. I guess my syntax is right. I'm hereby attaching my code and case files. If you are free, kindly check it please. Thank you |
|
January 13, 2020, 11:25 |
|
#14 | |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15 |
Quote:
Please create a new thread for the new question. |
||
January 13, 2020, 21:09 |
|
#15 | |
Senior Member
|
Quote:
Thank you Adhiraj for your valuable time. *I will post my new query as a new thread. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cloud::storeGlobalPositions has not been called - How to call it? | mrishi | OpenFOAM Programming & Development | 16 | January 28, 2021 19:46 |
How is the turbulence model called in openfoam? | hz283 | OpenFOAM | 3 | May 4, 2017 21:20 |
terminate called after throwing an instance of 'int' | b614910 | SU2 | 10 | July 27, 2014 22:16 |
understanding how turbulence models are called | romant | OpenFOAM Programming & Development | 0 | March 21, 2012 09:22 |
reconstructParMesh not working with an axisymetric case | francesco | OpenFOAM Bugs | 4 | May 8, 2009 05:49 |