|
[Sponsors] |
[swak4Foam] how to implement fixedMean in groovyBC? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2013, 13:33 |
how to implement fixedMean in groovyBC?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
there is a BC for outlet named fixedMean.
it seema its main code is this: Code:
void fixedMeanFvPatchField<Type>::updateCoeffs() { if (this->updated()) { return; } Field<Type> newValues(this->patchInternalField()); Type meanValuePsi = gSum(this->patch().magSf()*newValues) /gSum(this->patch().magSf()); if (mag(meanValue_) > SMALL && mag(meanValuePsi)/mag(meanValue_) > 0.5) { newValues *= mag(meanValue_)/mag(meanValuePsi); } else { newValues += (meanValue_ - meanValuePsi); } this->operator==(newValues); fixedValueFvPatchField<Type>::updateCoeffs(); }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 1, 2013, 05:37 |
|
#2 |
Member
|
Well, it reads patch internal values:
Field<Type> newValues(this->patchInternalField()); It calculates and area averaged value: Type meanValuePsi = gSum(this->patch().magSf()*newValues)/gSum(this->patch().magSf()); Then, if the prescribed reference value (meanValue_) is not zero and the difference in magnitude between internal values and meanValue_ is higher than 50%, it scales the local imposed boundary value with the ratio between the desired and the obtained mean values otherwise the adjustment of boundary values is provided with a shift to correctly set the mean value. In both cases the newValues exactly fulfill the requirements of prescribed mean value. if (mag(meanValue_) > SMALL && mag(meanValuePsi)/mag(meanValue_) > 0.5) { newValues *= mag(meanValue_)/mag(meanValuePsi); } else { newValues += (meanValue_ - meanValuePsi); } Concerning the implementation in groovyBC, even though I'm not expert, I'm pretty sure you can implement this using the valueExpression. As I can see in fact, all the the required functions (sum,internalField,Sf and conditional operator) are implemented in groovyBC.
__________________
Cosimo Bianchini Ergon Research s.r.l. Via Panciatichi, 92 50127 Florence - ITALY Tel: +39 055 0763716 Mob: +39 320 9460153 e-mail: cosimo.bianchini@ergonresearch.it URL: www.ergonresearch.it |
|
July 1, 2013, 09:30 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi
thanks. newValues are replaced to the internalField,right? I don't think such a function there is in groovyBC to change internalField values unless dear Bernhard say something else.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 1, 2013, 10:10 |
|
#4 |
Member
|
No. newValues are imposed on the boundary as new fixedValue values.
this->operator==(newValues); fixedValueFvPatchField<Type>::updateCoeffs(); and that is what valueExpression does in groovy BC (if I did correctly understand groovy BC wiki, never went inside the code for further details sorry)
__________________
Cosimo Bianchini Ergon Research s.r.l. Via Panciatichi, 92 50127 Florence - ITALY Tel: +39 055 0763716 Mob: +39 320 9460153 e-mail: cosimo.bianchini@ergonresearch.it URL: www.ergonresearch.it |
|
July 1, 2013, 11:31 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
OK.then it fluctuate around the specified value according to internal values.
its so: BC*(neighbor value)/(mean of neighbor values) is it useful to use such a boundary in the case I've attached in the related topic? its a closed area that a part of right wall is opened.it seems that the pressure doesn't decrease to the value I've set.I guess its a physical feature rather than numerical if you agree. http://www.cfd-online.com/Forums/ope...tml#post436854 I'll be thankful if you take a look into it.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 1, 2013, 12:15 |
|
#6 |
Member
|
Rather than fluctuating (never used for transient cases) I would say it converges to a profile which is in equilibrium with the internal solution maintaining the specified mean value.
They case you posted in the other thread is barely understandable so I cannot give any suggestions.
__________________
Cosimo Bianchini Ergon Research s.r.l. Via Panciatichi, 92 50127 Florence - ITALY Tel: +39 055 0763716 Mob: +39 320 9460153 e-mail: cosimo.bianchini@ergonresearch.it URL: www.ergonresearch.it |
|
July 1, 2013, 13:04 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
they are simple.one is a tube full of a fluid at rest in 1800000 pa that its boundary opens completely to 800000 pa BC and another opening is smaller than previous case.but if you see vectors near the opening could see a unstable situation on neighbor cells of opening patch.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
July 2, 2013, 03:32 |
|
#8 |
Member
|
With such a pressure ratio I don't think it is a good idea to put a fixed pressure BC at the discharge orifice. I believe your convergence problem are not related to the type of pressure boundary conditions but to the position of the outlet.
__________________
Cosimo Bianchini Ergon Research s.r.l. Via Panciatichi, 92 50127 Florence - ITALY Tel: +39 055 0763716 Mob: +39 320 9460153 e-mail: cosimo.bianchini@ergonresearch.it URL: www.ergonresearch.it |
|
July 2, 2013, 03:41 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
i want an outlet with minimum of pressure that can be reaced by the flow.
Then What BC you suggest other than fixed pressure BC? I can't changeThe geometry of problem,its fixed. Its a physical(maybe flow can't reach to a pressure lower than a limit that i don't know whats that limit) problem or numerical in your opinion? Thanks for consideration.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC | zanilu70 | OpenFOAM Community Contributions | 4 | December 13, 2016 06:46 |
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam | dani2702 | OpenFOAM Community Contributions | 0 | November 17, 2016 03:30 |
[swak4Foam] groovyBC issue - k and epsilon | sagnikmazumdar | OpenFOAM Community Contributions | 24 | March 1, 2015 07:16 |
[swak4Foam] parabolic velocity profile with fluctuations (groovyBC?) | newOFuser | OpenFOAM Community Contributions | 17 | July 15, 2013 17:27 |
[swak4Foam] how to implement second order derivative with groovyBC like the formula? | immortality | OpenFOAM Community Contributions | 0 | July 9, 2013 08:32 |