|
[Sponsors] |
fixedGradientFvPatchScalarField or fixedGradientFvPatchField? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 10, 2024, 07:46 |
fixedGradientFvPatchScalarField or fixedGradientFvPatchField?
|
#1 |
New Member
Teddy Liu
Join Date: May 2024
Posts: 5
Rep Power: 2 |
Hello!
I am using OpenFOAM-v2212, and trying to understand the boundary condition: fixedFluxPressure. But I find the code rather strange, as it calls member functions from a class that seems does not exist (fixedGradientFvPatchScalarField). I searched in the API guide only to find a class named "fixedGradientFvPatchField". How could this code possibly run without errors? I think it may be a version-related issue, but I still can't understand. in fixedFluxPressureFvPatchScalarField.C: Code:
void Foam::fixedFluxPressureFvPatchScalarField::updateSnGrad ( const scalarField& snGradp ) { if (updated()) { return; } curTimeIndex_ = this->db().time().timeIndex(); gradient() = snGradp; fixedGradientFvPatchScalarField::updateCoeffs(); // could it probably be fixedGradientFvPatchField? } |
|
November 10, 2024, 14:10 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 741
Rep Power: 14 |
The answer is a little subtle. Class fixedGradientFvPatchScalarField is the implementation of the fixedGradientFvPatchField class, for a scalar field (the field type is the class parameter). It is generated in fixedGradientFvPatchFields.H (https://www.openfoam.com/documentati...8H_source.html), which calls a macro in fvPatchField.H
(https://www.openfoam.com/documentati...ce.html#l00715) to generate the class. That's why you can't find it in Doxygen, or with a grep on the src folder. |
|
November 10, 2024, 14:19 |
|
#3 |
Senior Member
|
The dependency graph at https://www.openfoam.com/documentati...rField_8H.html
does show that fixedFluxPressureFvPatchScalarField does call fixedGradientFvPatchScalarField. Not sure how this complements what Tobermory provides as information. |
|
November 11, 2024, 08:18 |
|
#4 |
New Member
Teddy Liu
Join Date: May 2024
Posts: 5
Rep Power: 2 |
Wow, Thank You, Tobermory!! It really helped! I never thought it would be a generate class.
|
|
November 11, 2024, 08:30 |
|
#5 | |
New Member
Teddy Liu
Join Date: May 2024
Posts: 5
Rep Power: 2 |
Quote:
|
||
Tags |
boundary condition, fixedfluxpressure, fixedgradient |
Thread Tools | Search this Thread |
Display Modes | |
|
|