View Issue Details

IDProjectCategoryView StatusLast Update
0002628OpenFOAMBugpublic2017-07-20 21:37
Reporterramwi Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Versiondev 
Summary0002628: tractionDisplacementFvPatchVectorField.C - rhoE is loaded as E
DescriptionLines 156-157 of tractionDisplacementFvPatchVectorField.C

const fvPatchField<scalar>& rhoE =
patch().lookupPatchField<volScalarField, scalar>("E");
-> field E is loaded as rhoE

Line 162

scalarField E(rhoE/rho);
-> the field is once again divided by rho
Steps To ReproduceNothing is needed - can be viewed in the code
Additional Informationpresent in oF4.x as well
TagstractionDisplacement

Activities

henry

2017-07-20 11:14

manager   ~0008422

It is not clear what you want changed and for what reason. Do you have any cases which show that there is a problem?

ramwi

2017-07-20 13:14

reporter   ~0008424

I am sorry for not providing a clear enough report.

The original proposed change was:

---
const fvPatchField<scalar>& rhoE =
        patch().lookupPatchField<volScalarField, scalar>("E");
->
const fvPatchField<scalar>& E =
        patch().lookupPatchField<volScalarField, scalar>("E");
---
and
---
scalarField E(rhoE/rho); -> xxxx
---

However, you got me thinking. My original train of thought was:
1. In readMechanicalProperties.H in the solidDisplacementFoam, the user-suplied Young modulus is loaded as rhoE and then it follows,

---
Info<< "Normalising E : E/rho\n" << endl;
volScalarField E(rhoE/rho);

Info<< "Calculating Lame's coefficients\n" << endl;

volScalarField mu(E/(2.0*(1.0 + nu)));
volScalarField lambda(nu*E/((1.0 + nu)*(1.0 - 2.0*nu)));
volScalarField threeK(E/(1.0 - 2.0*nu));
---

Q: So, the volScalarField registered as E is already normalized?

2. In tractionDisplacementFvPatchVectorField.C, there is

---
const fvPatchField<scalar>& rhoE =
        patch().lookupPatchField<volScalarField, scalar>("E");
---

and it follows,

---
scalarField E(rhoE/rho);
scalarField mu(E/(2.0*(1.0 + nu)));
scalarField lambda(nu*E/((1.0 + nu)*(1.0 - 2.0*nu)));
scalarField threeK(E/(1.0 - 2.0*nu));
---

3. So, it seemed to me, that the looked up field rhoE is already normalized and it is "normalized again" by scalarField E(rhoE/rho);.

I bumped into this while I was writing a custom solver for heterogenous materials.

On the other hand, I could have made some mistake in my thinking. I will try to post this as a question on the forum in hope to reach some consensus or to discover my mistake. If needed, I will come back here with more detailed problem description. In the meantime, I am sorry to foul the bug tracker.

henry

2017-07-20 13:52

manager   ~0008425

> So, the volScalarField registered as E is already normalized?

If you haven't provided the "E" field:

        EPtr.reset
        (
            new volScalarField
            (
                EHeader,
                mesh,
                dimensionedScalar
                (
                    "Erho",
                    dimMass/dimLength/sqr(dimTime),
                    rhoEValue
                )
            )
        );

if you have then what dimensions did you give it and did the case run?

The "E" field in the code is NOT normalized by rho:

    volScalarField& rhoE = EPtr();

the code

    Info<< "Normalising E : E/rho\n" << endl;
    volScalarField E(rhoE/rho);

will create an E field which in named "(E/rho)" not "E".

OK this is a bit confusing but it is correct. If you think it is incorrect you will need to provide a case which demonstrates this.

ramwi

2017-07-20 14:51

reporter   ~0008426

OK, this was the stupid mistake to possibility of which I was refering. I got confused between EPtr and volScalarField E named "(E/rho)"

Thank you for your patience and advice. And sorry to waste your time.

Issue History

Date Modified Username Field Change
2017-07-20 10:59 ramwi New Issue
2017-07-20 10:59 ramwi Tag Attached: tractionDisplacement
2017-07-20 11:14 henry Note Added: 0008422
2017-07-20 13:14 ramwi Note Added: 0008424
2017-07-20 13:52 henry Note Added: 0008425
2017-07-20 14:51 ramwi Note Added: 0008426
2017-07-20 21:37 henry Assigned To => henry
2017-07-20 21:37 henry Status new => closed
2017-07-20 21:37 henry Resolution open => no change required