solids4foam developping new nonLinearGeometry mechanicalLaws looks for volScalarField
Hi,
I am trying to develop new nonLinearGeomtry Mechanical law based on the class mechanicalModel/mechanicalLaws/linearGeometryLaws/linearElasticFromFile I am doing this by modifying neoHookeanElastic model so that the mechanicalProperties looks for files "mu" and "K" as volScalarField @bigphil did a similar linearGeometryLaws linearElasticFromFile. @Daniel_Khazaei did a mechanicalLaw with time-varying E timeVaryingNeoHookeanElastic. code in neoHookeanElasticFromFile.C : Quote:
|
Hi Smail,
You seem to be on the right track. To make a neoHookeanElasticFromFile, I would take the following steps:
Philip |
As Phil was already replying, I guess there is no need to give any further information. Please note: I am not very active on researchgate and hence, saw your message luckily inside my inbox :)
Good luck and keep foaming. Thanks for your support Phil - its good to have you around here on cfd-online.com (as well as all other volunteers). |
Quote:
Hi Philip, Thanks for your guidance. I appreciate it. That is exactly the procedure I am following. The new model is now successfully compiled and I am testing on few cases and will let you know if the model is fitting the needs of nonLinearGeomtryLaw functionalities. If everything goes fine I will request a commit into repository solids4foam-release. I started first by duplicating neoHookeanElastic and rename everything into new model, and commenting out other constructors contents. Just I like to highlight the errors I debugged while the conversion of the dimensionedScalar into volScalarField. By switching mu and K into volScalarField , it turns out while compiling that the member function requires some modifications in other parts of the code, such as in the constructor for example, to correctly account for these volsScalarFields. Code:
error: cannot convert ‘Foam::volScalarField’ {aka ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} to ‘const dimensionedScalar&’ {aka ‘const Foam::dimensioned<double>&’} Which needed to add interpolations into the constructors : Code:
muf_(fvc::interpolate(mu_)), As a consequence also surface field should be added to the class header should Code:
surfaceScalarField muf_; other error in the member Functions: Code:
error: no match for ‘operator=’ (operand types are ‘Foam::surfaceSymmTensorField’ {aka ‘Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvsPatchField, Foam::surfaceMesh>’} and ‘Foam::tmp<Foam::Field<Foam::SymmTensor<double> > >’) I commented out linearised elasticity NOT to allowing solver enforceLinear switch. Would you have any other comments feel free to let me know here. |
Additional changes required in mechanicalLaw
Additional changes required in mechanicalLaw to overcome the error:
Code:
error: cannot convert ‘Foam::volScalarField’ {aka ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} to ‘const dimensionedScalar&’ {aka ‘const Foam::dimensioned<double>&’} It turned out that the current mechanicalLaw needs other changes in order to allow conversion of mu and K into volScalarField. since the two quantities are defined in the mechanicalLaw.H as: Code:
I am saying that since there is a definition of the mu and K in the original mechanicalLaw as dimensionedScalar and I need to convert that to volScalarField. In other word, Do I need to compile another newMechanicalLaw classe to supply to the my model. |
Hi Aero_Smail,
In this case, the easiest thing is to re-write the "updateF" function directly in your new neoHookeanElasticFromFile class correct function, e.g. Code:
void Foam::neoHookeanElasticFromFile::correct(volSymmTensorField& sigma) |
compiled successfully
Dear Big Philip
That's very helpful to overcome this situation. Thank you for your guidance. It is successfully compiled and the new library should be called in the controlDict. I did add the updateF function into the new model and I did similarly to the other field function updateFf . This is updating the sigma and I am testing on some cases to check the calculations are rational and let you know as soon as. Thanks a lot Big Philip. |
All times are GMT -4. The time now is 07:54. |